csppass
连续 00 XP登录 / 注册
201921阅读程序枚举与模拟普及-

程序(一):多少长度时恰好最多36个字符不同

题目

阅读下面的程序,回答问题。 #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; } 若输入的字符串长度为( ),那么输入的字符串跟输出的字符串相比,至多有36个字符不同。

考点拆解
程序阅读与结果判断
易错提醒
阅读程序题要按变量变化顺序手推,不要跳步
选择题要检查单位、边界和题目中的否定词