語法:
#include<iostream>
#include<cstdio>
using namespace std;
int main (void)
{
char buffer[1024];
int a,b;
char c;
while(gets(buffer)){
if(sscanf(buffer,"%d%c%d",&a,&c,&b)==3){
printf("%d %d\n",a,b);
continue;
}
if(sscanf(buffer,"%d",&a)==1){
b=1;
printf("%d %d\n",a,b);
continue;
}else{
a=0;
b=1;
printf("%d %d\n",a,b);
continue;
}
}
system("pause");
return 0;
}