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

TOP

返回列表