返回列表 發帖
本帖最後由 黃品禎 於 2022-8-27 14:10 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.         cout<<"---判斷a,b---" <<endl;
  6.         int a,b;
  7.         cout<<"請輸入a:"<<endl;
  8.         cin>>a;
  9.         cout<<"請輸入b:"<<endl;
  10.         cin>>b;
  11.         if(a>b){
  12.          cout<<a<<">"<<b<<endl;}
  13.          else if(a==b){
  14.         cout<<a<<"="<<b;}
  15.         else{
  16.         cout<<a<<"<"<<b;}
  17.         system ("pause");
  18.         return 0;
  19. }
複製代碼

TOP

返回列表