我不理解为啥输出完100个字母之后,会继续输出几个汉字哇?有没有解决方法各位亲,谢谢各位了orz
void practice() {
char putout[100]{};
srand(time(NULL));
int i, j;
for (i = 0; i < 100; i++) {
putout[i] = rand() % 25+1 + 'a';
}
printf("%s", putout);
}
int main() {
while(1) {
printf("是否开始打字训练?1(继续)/2(取消)\n");
int n;
char input[100];
scanf_s("%d", &n);
if (n == 1) {
practice();
scanf("%s", &input);
}
}
}