getchar函数与scanf函数的是怎么样读入的呢?
#include<stdio.h>int main()
{
int i,n;
printf("This program prints a table of squares.\n");
printf("Enter number of entries in table:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("%10d%10d\n",i,i*i);
if(i%24==0){
printf("Press Enter to Continue......");
if(getchar()!='\n')
break;
else continue;}
}
return 0;
}
此题目的要求是在每次输出24个平方数之后,就显示Press Enter to Continue......,然后按下enter键就继续输出,上面的程序是我写的,各位帮忙看一下哈!谢谢了!