代码: 全选
#include <stdio.h>
int main()
{
int a, b;
printf("enter:");
int n = scanf("%d %d", &a, &b);
if(n<2)
{
printf("err--n:%d\n", n);
printf("enter:");
//fflush(stdin);
scanf("%d %d", &a, &b);
}
return 0;
}
代码: 全选
[zongzw@localhost stdin]$ a.out
enter:1 2
[zongzw@localhost stdin]$ a.out
enter:[b]1,[/b]
err--n:1
enter:[zongzw@localhost stdin]$