本帖最後由 楊芊琦 於 2022-10-29 15:13 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- int a,b,c;
- cin>>a>>b>>c;
- if(a>b and b>c)
- {
- cout<<a<<">"<<b<<">"<<c<<endl;
- }
- else if(a>c and c>b)
- {
- cout<<a<<">"<<c<<">"<<b<<endl;
- }
- else if(b>a and a>c)
- {
- cout<<b<<">"<<a<<">"<<c<<endl;
- }
- else if(b>c and c>a)
- {
- cout<<b<<">"<<c<<">"<<a<<endl;
- }
- else if(c>a and a>b)
- {
- cout<<b<<">"<<a<<">"<<c<<endl;
- }
- else if(c>b and b>a)
- {
- cout<<c<<">"<<b<<">"<<a<<endl;
- }else if(c>a and a>c)
- {
- cout<<c<<">"<<a<<">"<<b<<endl;
- }
- else
- {
- cout<<"內有相等數,電腦懶得數"<<endl;
- }
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |