You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
795 B
34 lines
795 B
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
|
|
set<char> _set = {'!', '@', '#', '$'};
|
|
|
|
void check(string t) {
|
|
int dx = 0, xx = 0, sz = 0, ts = 0;
|
|
for (int i = 0; i < t.size(); i++) {
|
|
if (isupper(t[i])) dx = 1;
|
|
if (islower(t[i])) xx = 1;
|
|
if (_set.count(t[i])) ts = 1;
|
|
if (isdigit(t[i])) sz = 1;
|
|
if (!isupper(t[i]) && !islower(t[i]) && !isdigit(t[i]) && !_set.count(t[i])) return;
|
|
}
|
|
if (dx + xx + sz < 2) return;
|
|
if (ts == 0) return;
|
|
cout << t << endl;
|
|
}
|
|
int main() {
|
|
string s;
|
|
cin >> s;
|
|
s += ',';
|
|
|
|
string t = "";
|
|
for (int i = 0; i < s.size(); i++) {
|
|
if (s[i] == ',') {
|
|
check(t);
|
|
t = "";
|
|
} else
|
|
t += s[i];
|
|
}
|
|
|
|
return 0;
|
|
} |