我是用C编的main(){ float a,b; char c; scanf("%f%c%f",a,c,b); swatch(c) { case'+':printf("%f",a+b);break; case'-':printf("%f",a-b);break; case'*':printf("%f",a*b);break; case'/':printf("%f",a/b);break; }}