返回列表 發帖
  1. #include<cstdlib>
  2. #include<iostream>
  3. using namespace std;
  4. int main()

  5. {
  6.     int x,y;
  7.    
  8.     cout<<"請輸入x的值"<<endl;
  9.     cin>>x;
  10.     cout<<"請輸入y的值"<<endl;
  11.     cin>>y;
  12.     if((x!=0)&&(y!=0))
  13.     {
  14.           cout<<"當x的質為:"<<x;cout<<"當y的質為:"<<y<<endl;
  15.           cout<<"x+y="<<x+y<<endl;
  16.           cout<<"x-y="<<x-y<<endl;
  17.           cout<<"x*y="<<x*y<<endl;
  18.           cout<<"x/y="<<x/y<<endl;
  19.           cout<<"x%y="<<x%y<<endl;   
  20.             
  21.     }
  22.     else
  23.     {
  24.             cout<<"請重新輸入"<<endl;
  25.    
  26.     }
  27.             
  28.    

  29.          
  30.             
  31.    
  32.    
  33.    
  34.          
  35.    
  36.    
  37.     system("pause");
  38.     return 0;
  39. }
複製代碼

TOP

返回列表