返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x=10,y=10;
  7.    
  8.    
  9.    cout<<"請輸入X"<<endl;
  10.    cin>>x;
  11.    cout<<"請輸入Y"<<endl;
  12.    cin>>y;
  13.     cout<<"X+Y="<<x+y<<endl;
  14.     cout<<"X-Y="<<x-y<<endl;
  15.     cout<<"X*Y="<<x*y<<endl;
  16.     cout<<"X/Y="<<x/y<<endl;
  17.     cout<<"X%Y="<<x%y<<endl;
  18.     if(x>y)
  19. {
  20.              cout<<"X>Y"<<endl;  
  21. }
  22.      else if(x<y)
  23. {
  24.              cout<<"X<Y"<<endl;
  25. }
  26.      if(x=y)
  27. {
  28.              cout<<"X=Y"<<endl;
  29. }
  30.    
  31.     system("pause");
  32.     return 0;
  33. }
複製代碼

TOP

返回列表