
1条回答 默认 最新
赵4老师 2021-11-01 19:25关注char s[30];
int a,b;
while(1){
rewind(stdin);
fgets(s,30,stdin);
if (2==sscanf("%d%d",&a,&b)){
//正确
break;
}else{
//错误
}
}本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
char s[30];
int a,b;
while(1){
rewind(stdin);
fgets(s,30,stdin);
if (2==sscanf("%d%d",&a,&b)){
//正确
break;
}else{
//错误
}
}