#include "stdio.h"
int main()
{
float a,b,z;
char ch;
for(;;){
printf("input two number:\n");
scanf("%f%f",&a,&b);
printf("zhifu:");
scanf(" %c",&ch);
switch(ch)
{
case '+': z=a+b;break;
case '-': z=a-b;break;
case '*': z=a*b;break;
case '/': z=a/b;break;
}
printf("%.2f%c%.2f=%.2f\n",a,ch,b,z);
}
getch();
}
是%c前加空格和%c前没加空格,我不理解这是为什么?