parent
10638f3113
commit
ddce6e2d3e
@ -0,0 +1,34 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in new issue