最简单的计算器。2018/9/13

/********
简单的计算器。

*/

#include<stdio.h>
//加法函数。
int jf1(int x,int y){
return x+y;
}
//减法函数。
int jf2(int x,int y){
return x-y;
}
//乘法函数。
int cf1(int x,int y){
return x*y;
}
//除法函数
int cf2(int x,int y){
return x/y;
}
int main(void){
int a=0,b=0,c1=0,c2=0,c3=0,c4=0;
printf("please enter numbers:\n");
scanf("%d,%d",&a,&b);
printf("结果是result:\n");
c1=jf1(a,b);//函数调用
c2=jf2(a,b);//函数调用
c3=cf1(a,b);//函数调用
c4=cf2(a,b);//函数调用
printf("%d\n%d\n%d\n%d\n",c1,c2,c3,c4);
return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_37536336/article/details/82683634