#include
void function(int a, int b)
{
printf("%d add %d = %d\n",a, b, a+b); //加法运算
printf("%d sub %d = %d\n",a, b, a-b); //加法运算
printf("%d mul %d = %d\n",a, b, a*b); //乘法运算
printf("%d div %d = %d\n",a, b, a/b); //除法运算
}
int main()
{
int a,b;
printf("please input a and b");
scanf("%d%d",&a,&b);
function(a,b);
return 0;
}
#include
#include
#include
using namespace std;
main(void)
{
float a,b;
char ch;
while(1)
{
cin>>a>>ch>>b;
//scanf("%d%c%d",&a,&ch,&b);
if(ch=='+')
//printf("= %f \n",a+b);
cout<<"="< if(ch=='-')
//printf("= %f \n",a-b);
cout<<"="<
//printf("= %f \n",a*b);
cout<<"="< if(ch=='/')
//printf("= %f \n",a/b);
cout<<'='< system("cls");
}
return 0;
}
#include
using namespace std;
main()
{
float a,b;
char ch;
while(1)
{
cin>>a>>ch>>b;
//scanf("%d%c%d",&a,&ch,&b);
if(ch=='+')
//printf("= %f \n",a+b);
cout<<"="< if(ch=='-')
//printf("= %f \n",a-b);
cout<<"="<
//printf("= %f \n",a*b);
cout<<"="< if(ch=='/')
//printf("= %f \n",a/b);
cout<<'='< system("cls");
}
return 0;
}