提交时间:2024-04-14 12:10:16
运行 ID: 28296
#include <cctype> #include <cstdio> #include <iostream> using namespace std; using i64 = long long; int main() { #ifndef ONLINE_JUDGE freopen("aha.in", "r", stdin); freopen("aha.out", "w", stdout); #endif string s; cin >> s; int cnt = 0; string part[4] = { "", "", "", "" }; for (char ch : s) { if (islower(ch)) part[0] += ch; else if (isupper(ch)) part[1] += ch; else if (isdigit(ch)) part[2] += ch; else part[3] += ch; } for (const auto& s : part) cnt += int(!s.empty()); cout << "password level:" << cnt << '\n'; for (int i = 0; i < 4; ++i) { if (part[i].empty()) cout << "(Null)" << '\n'; else cout << part[i] << '\n'; } fclose(stdin); fclose(stdout); return 0; }