#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int m;int n;
cout<<"輸入m的值:\r\n";
cin>>m;
cout<<"輸入n的值:\r\n";
cin>>n;
if
if(m!=0 && n!=0)
{
cout<<"m+n="<<m+n<<endl;
cout<<"m-n="<<m-n<<endl;
cout<<"m*n="<<m*n<<endl;
cout<<"m/n="<<m/n<<endl;
cout<<"m%n="<<m%n<<endl;
}
else
{
cout<<"m與n值不能為0,重新輸入!!\r\n";
}
system("pause");
return 0;
} |