69,380
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
void main() {
int n,a,b;
char c;
while (1) {
printf("\nInput two number(for example:1 2):");
fflush(stdout);
rewind(stdin);
n=scanf("%d%d%c",&a,&b,&c);
if (EOF==n) return;
if (3==n && '\n'==c) break;
}
printf("%d %d\n",a,b);
}
Input two number(for example:1 2):1,2
Input two number(for example:1 2):a,b
Input two number(for example:1 2):123
a
Input two number(for example:1 2):1 2c
Input two number(for example:1 2):1 2
1 2