- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int a,b,c ;
- cout<<"請依序輸入三個數";
- cin>>a>>b>>c;
- if(a>b and b>c)
- {
- cout<<a<<">"<<b<<">"<<c<<"\n";
- }
- else if(a>c and c>b)
- {
- cout<<a<<">"<<c<<">"<<b<<"\n";
- }
- else if(b>a and a>c)
- {
- cout<<b<<">"<<a<<">"<<c<<"\n";
- }
- else if(b>c and b>a)
- {
- cout<<b<<">"<<c<<">"<<a<<"\n";
- }
- else if(c>a and a>b)
- {
- cout<<c<<">"<<a<<">"<<b<<"\n";
- }
- else if(c>b and b>a)
- {
- cout<<c<<">"<<b<<">"<<a<<"\n";
- }
- else
- {
- cout<<"2數或3數相等";
- }
-
-
- system("pause");
- return 0;
- }
複製代碼 |