1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #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; } |
0 of 6 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 6 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
16. 输入的字符串只能由小写字母或大写字母组成。
17. 若将第 8 行的i = 1
改为i = 0
,程序运行时会发生错误。
18. 若将第 8 行的i <= n
改为i * i <= n
,程序运行时结果不会改变。
19. 若输入的字符串全部由大写字母组成,那么输出的字符串就跟输入的字符串一样。
20. 若输入的字符串长度为 18,那么输入的字符串跟输出的字符串相比,至多有( )个字符不同。
21. 若输入的字符串长度为( ),那么输入的字符串跟输出的字符串相比,至多有 36 个字符不同。