scanf 函数的输入问题
#include <stdio.h> // 无问题的代码 重复输入保证不问题
#include <stdlib.h>
main()
{
int a,b;
int c;
while(1){
scanf("%d %d %d",&c,&a,&b);
if( c == 5) printf("1 %d %d %d\n",a,b,c);
printf("2 %d %d %d",a,b,c);
system("pause");}
return 0;
}
#include <stdio.h> // 是有问题的..这个很让人纠结... 你可以自己试几个...
#include <stdlib.h>
main()
{
int a,b;
int c;
while(1){
scanf("%c %d %d",&c,&a,&b);
if( c == 'c') printf("1 %d %d %c\n",a,b,c);
printf("2 %d %d %c",a,b,c);
system("pause");}
return 0;
}
我很想弄明白这是怎么回事 . 是不是输入时的缓冲区有问题? 期待高手..