scanf(“%d\n") scanf(“%d")//的区别
#include<stdio.h>int main()
{#include<stdio.h>
int main()
{
int minutes;
printf("enter the minutes\n");
while(minutes>=0)
{
scanf("%d\n",&minutes);
printf(%d %d\n,minutes/60,minutes%60);
}
getch();
return 0;
}
结果: enter the minutes
60 //回车
70
1 0
80
1 10 //显示的上一次的结果。
int minutes;
printf("enter the minutes\n");
while(minutes>=0)
{
scanf("%d",&minutes);
printf(%d %d\n,minutes/60,minutes%60);
}
getch();
return 0;
} //这个才正常,怎麽回事。。