赞
踩
题目:
代码:
- #include<iostream>
- using namespace std;
- int a,b,c;
- int main(){
- cin>>a>>b>>c;
- if(a>b&&a>c&&b>c){//a>b>c
- cout<<c<<" "<<b<<" "<<a;
- }
- else if(a>b&&a>c&&b<c){//a>c>b
- cout<<b<<" "<<c<<" "<<a;
- }
- else if(b>a&&b>c&&a>c){//b>a>c
- cout<<c<<" "<<a<<" "<<b;
- }
- else if(b>a&&b>c&&b<c){//b>c>a
- cout<<a<<" "<<c<<" "<<b;
- }
- else if(c>b&&c>a&&a>b){//c>a>b
- cout<<b<<" "<<a<<" "<<c;
- }
- else if(c>b&&c>a&&a<b){//c>b>a
- cout<<a<<" "<<b<<" "<<c;
- }
- return 0;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。