Merge branch 'main' of http://10.10.14.176:3000/huanghai/python
commit
fd0abc031e
@ -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;
|
||||||
|
}
|
Binary file not shown.
@ -0,0 +1,39 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
string zshiliu(int u) {
|
||||||
|
char q, p;
|
||||||
|
string s = "";
|
||||||
|
if (u / 16 >= 10)
|
||||||
|
p = 'A' + u / 16 - 10;
|
||||||
|
else
|
||||||
|
p = '0' + u / 16;
|
||||||
|
s += p;
|
||||||
|
if (u % 16 >= 10)
|
||||||
|
q = 'A' + u % 16 - 10;
|
||||||
|
else
|
||||||
|
q = '0' + u % 16;
|
||||||
|
s += q;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
int zshi(string s) {
|
||||||
|
int a = 0;
|
||||||
|
if (s[0] >= 'A' && s[0] <= 'F')
|
||||||
|
a = (s[0] - 'A' + 10) * 16;
|
||||||
|
else if (s[0] >= '0' && s[0] <= '9')
|
||||||
|
a = (s[0] - '0') * 16;
|
||||||
|
|
||||||
|
int b = 0;
|
||||||
|
if (s[1] >= 'A' && s[1] <= 'F')
|
||||||
|
b = (s[1] - 'A' + 10);
|
||||||
|
else if (s[1] >= '0' && s[1] <= '9')
|
||||||
|
b = (s[1] - '0');
|
||||||
|
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cout << zshiliu(10) << endl;
|
||||||
|
cout << zshi("FF") << endl;
|
||||||
|
cout << zshi("AA") << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in new issue