代码无法按照我想要的方式工作。
#include<stdio.h>
int main()
{
char another;
int number;
do
{
printf("Enter a number.\n");
scanf("%d", &number);
printf("The square of %d is %d.\n", number, number*number);
printf("Do you want to enter another number?\n");
scanf("%c", &another);
}while(another=='y');
return 0;
}
如果我输入“ y”,程序将关闭。