| ||||||
| ||||||
| ||||||
你这'+','-','*','/'是字符.要用引号引起来.你试一下
#include <conio.h> /* 此头函数请不要删除 */
#include <stdio.h>
main()
{int x,y,z;
char op;
printf("please input x op y:");
scanf("%d%c%d",&x,&op,&y);
printf("%d%c%d",x,op,y);
switch(op)
{case '+': z=x+y;break;
case '-': z=x-y;break;
case '*': z=x*y;break;
case '/': z=x/y;break;
default:printf("input is Error");
}
printf("=%d",z);
getch(); /* 此语句请不要删除*/
}