#include <iostream>
#include <cctype> // untuk fungsi isdigit, isupper, islower
using namespace std;
int main() {
string password;
int digitCount = 0, upperCount = 0, lowerCount = 0, symbolCount = 0;
// Membaca input kata sandi dari pengguna
cout << "@bCd3: ";
getline(cin, password);
// Menghitung jumlah karakter
for (char c : password) {
if (isdigit(c)) {
digitCount++;
} else if (isupper(c)) {
upperCount++;
} else if (islower(c)) {
lowerCount++;
} else {
symbolCount++;
}
}
// Menampilkan hasil
cout << "1: " << digitCount << endl;
cout << "1: " << upperCount << endl;
cout << "2: " << lowerCount << endl;
cout << "1: " << symbolCount << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y2N0eXBlPiAvLyB1bnR1ayBmdW5nc2kgaXNkaWdpdCwgaXN1cHBlciwgaXNsb3dlcgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgc3RyaW5nIHBhc3N3b3JkOwogICAgaW50IGRpZ2l0Q291bnQgPSAwLCB1cHBlckNvdW50ID0gMCwgbG93ZXJDb3VudCA9IDAsIHN5bWJvbENvdW50ID0gMDsKCiAgICAvLyBNZW1iYWNhIGlucHV0IGthdGEgc2FuZGkgZGFyaSBwZW5nZ3VuYQogICAgY291dCA8PCAiQGJDZDM6ICI7CiAgICBnZXRsaW5lKGNpbiwgcGFzc3dvcmQpOwoKICAgIC8vIE1lbmdoaXR1bmcganVtbGFoIGthcmFrdGVyCiAgICBmb3IgKGNoYXIgYyA6IHBhc3N3b3JkKSB7CiAgICAgICAgaWYgKGlzZGlnaXQoYykpIHsKICAgICAgICAgICAgZGlnaXRDb3VudCsrOwogICAgICAgIH0gZWxzZSBpZiAoaXN1cHBlcihjKSkgewogICAgICAgICAgICB1cHBlckNvdW50Kys7CiAgICAgICAgfSBlbHNlIGlmIChpc2xvd2VyKGMpKSB7CiAgICAgICAgICAgIGxvd2VyQ291bnQrKzsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzeW1ib2xDb3VudCsrOwogICAgICAgIH0KICAgIH0KCiAgICAvLyBNZW5hbXBpbGthbiBoYXNpbAogICAgY291dCA8PCAiMTogIiA8PCBkaWdpdENvdW50IDw8IGVuZGw7CiAgICBjb3V0IDw8ICIxOiAiIDw8IHVwcGVyQ291bnQgPDwgZW5kbDsKICAgIGNvdXQgPDwgIjI6ICIgPDwgbG93ZXJDb3VudCA8PCBlbmRsOwogICAgY291dCA8PCAiMTogIiA8PCBzeW1ib2xDb3VudCA8PCBlbmRsOwoKICAgIHJldHVybiAwOwp9