试题链接 https://ks.wjx.top/jq/92546297.aspx
阅读一
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
char s1[100];
int len, j = 0;
cin >> s;
len = s.size();
memset(s1, 0, sizeof(s1));
for (int i = 0; i < len; i ++) {
if (i % 2 == 0)
if ((s[i] >= 'A' && s[i] < 'Z') || (s[i] >= 'a' && s[i] < 'z')) {
s1[j] = s[i] + 1;
++ j;
}
}
cout << s1 << endl;
return 0;
}
阅读二
#include <bits/stdc++.h>
using namespace std;
int main() {
int a[1001], i, j, t, n;
for (i = 0; i <= 1000; i ++)
a[i] = 0;
scanf("%d", &n);
for (i = 1; i <= n; i ++) {
scanf("%d", &t);
a[t] ++;
}
for (i = 1000; i >= 0; i --)
for (j = 1; j <= a[i]; j ++)
printf("%d ", i);
return 0;
}