杭电ACM1170的输入问题
#include<stdio.h>int main()
{
int oper1,oper2,N,k;
char fs;
scanf("%d",&N);
for(k=0;k<N;k++)
{
getchar();//这句你去掉运行和加上运行怎么结果不一样??
scanf("%c %d %d",&fs,&oper1,&oper2);
switch(fs)
{
case '+':
printf("%d\n",oper1+oper2);
break;
case '-':
printf("%d\n",oper1-oper2);
break;
case '*':
printf("%d\n",oper1*oper2);
break;
case '/':
printf("%.2f\n",(double)oper1/(double)oper2);
break;
}
}
return 0;
}