#include <cstdio>
#include <cstring>
using namespace std;
char st[100];
int main() {
scanf("%s", st);
int n = strlen(st);
for (int i = 1; i <= n; ++i) {
if (n % i == 0) {
char c = st[i - 1];
if (c >= 'a')
st[i - 1] = c - 'a' + 'A';
}
}
printf("%s", st);
return 0;
}
若输入的字符串全部由大写字母组成,那么输出的字符串就跟输入的字符串一样。
正确。

#include<cstdio>
using namespace std;
int n, m;
int a[100], b[100];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; ++i)
a[i] = b[i] = 0;
for (int i = 1; i <= m; ++i) {
int x, y;
scanf("%d%d", &x, &y);
if (a[x] < y && b[y] < x) {
if (a[x] > 0)

这篇博客整理了NOIP 2019年CSP-J1入门级初赛的内容,重点涉及C语言的字符串处理和算法应用。文章指出,当字符串由大写字母组成时,输出保持不变。同时,讨论了数组中重复数字可能导致的程序错误,并提出了相关代码填空问题。
最低0.47元/天 解锁文章
1746

被折叠的 条评论
为什么被折叠?



