返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.     re:
  6.     int a,b,c;
  7.     cout<<"請依序輸入三個數:"<<endl;
  8.     cin>>a>>b>>c;
  9.     if(a>b&&a>c)
  10.         cout<<"三數中最大的數為: "<<a<<endl;
  11.     else if(b>a&&b>c)
  12.         cout<<"三數中最大的數為: "<<b<<endl;
  13.     else if(c>b&&c>b)
  14.         cout<<"三數中最大的數為: "<<c<<endl;
  15.     else
  16.         cout<<"數字重複!"<<endl;
  17.     goto re;

  18.     system("pause");
  19.     return 0;
  20. }
複製代碼

TOP

返回列表