Compare commits

...

3 Commits

Author SHA1 Message Date
黄海 13eb128dd9 'commit'
1 year ago
黄海 ddce6e2d3e 'commit'
1 year ago
黄海 10638f3113 'commit'
1 year ago

@ -0,0 +1,30 @@
#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int b[N]; // 1、定义桶
/*
3 3
0 2 1
*/
int main() {
// 2、处理输入输出
int n, m;
cin >> n >> m; // n:有n个同学m:报了m次数
while (m--) {
int x;
cin >> x;
b[x] = 1;
}
bool flag = false;
for (int i = 0; i < n; i++)
if (!b[i]) {
flag = true;
cout << i << " ";
}
if (!flag) {
cout << n << endl;
}
return 0;
}

@ -0,0 +1,45 @@
#include <bits/stdc++.h>
using namespace std;
void check(string t) {
// 1、必须有大写小写数字三种中的两种
int dx = 0, xx = 0, sz = 0, ts = 0;
// 2、四个特殊字符必须有一个
// !@#$
// 3、不能出现其它字符
for (int i = 0; i < t.size(); i++) {
if (t[i] >= 'A' && t[i] <= 'Z')
dx = 1;
if (t[i] >= 'a' && t[i] <= 'z')
xx = 1;
if (t[i] == '!' || t[i] == '@' || t[i] == '#' || t[i] == '$')
ts = 1;
if (t[i] >= '0' && t[i] <= '9')
sz = 1;
if (!(t[i] >= 'A' && t[i] <= 'Z') && !(t[i] >= 'a' && t[i] <= 'z') && !(t[i] >= '0' && t[i] <= '9') &&
t[i] != '!' && t[i] != '@' && t[i] != '#' && 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,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;
}

@ -9,8 +9,8 @@ int n, m;
int main() {
cin >> n >> m;
for (int k = 1; k <= n * m; k++) { // 没有填充完毕
a[x][y] = k; // 在当前位置填充数字, 值在长大
for (int i = 1; i <= n * m; i++) { // 没有填充完毕
a[x][y] = i; // 在当前位置填充数字, 值在长大
// p是说方向数组中的游标它是需要变化的什么情况下变化呢
// 1、出界了就变化 2、遇到了障碍就变化
int tx = x + dx[p], ty = y + dy[p]; // 蛇准备去的位置

@ -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…
Cancel
Save