- #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(n==0)
- {
- cout<<"y值不能為0,重新輸入!!\r\n";
- }
- else
- {
- 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;
- }
-
-
-
-
-
- system("pause");
- return 0;
- }
複製代碼 |