Compare commits
3 Commits
1fb73d2bf1
...
13eb128dd9
Author | SHA1 | Date |
---|---|---|
|
13eb128dd9 | 1 year ago |
|
ddce6e2d3e | 1 year ago |
|
10638f3113 | 1 year ago |
@ -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;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int chenghebi(int u) {
|
||||
int t = u * 7;
|
||||
int sum = 0;
|
||||
while (t > 9) {
|
||||
sum = t / 10 + t % 10;
|
||||
t = sum;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int T;
|
||||
cin >> T;
|
||||
while (T--) {
|
||||
int n;
|
||||
int dj = 0;
|
||||
int k = 0;
|
||||
int c[10000] = {0};
|
||||
cin >> n;
|
||||
while (n != 0) {
|
||||
dj++;
|
||||
int a = n % 10;
|
||||
if ( dj% 2 == 0)
|
||||
c[dj] = a;
|
||||
else
|
||||
c[dj] = chenghebi(a);
|
||||
n /= 10;
|
||||
}
|
||||
for (int i = dj; i >= 1; i--) {
|
||||
k *= 10;
|
||||
k += c[i];
|
||||
|
||||
}
|
||||
|
||||
if (k % 8 == 0)
|
||||
cout << "T" << endl;
|
||||
else
|
||||
cout << "F" << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in new issue