#include<stdio.h>void main(){ char c; float x,y; int result; scanf("%c %f %f",&c,&x,&y); if(c=='+') result=(x+y); else if(c=='-') result=(x-y); else if(c=='/') result=(x/y); else if(c=='*') result=(x*y); else { printf("符号不合法\n"); return ; } printf("%d \n",result);}
转载于:https://www.cnblogs.com/tiezhu/p/5269777.html
相关资源:c语言四则运算的一个例子