3 solutions
-
-1
#include<bits/stdc++.h> using namespace std; int main() { int d,a,b,c; cin>>d; a=d%10; b=d/100; c=d/10%10; cout<<a<<b<<c<<endl; if (a>b>c) { cout<<a*100+b*10+c*1; } else if(a>c>b) { cout<<'2'<<endl; cout<<a*100+c*10+b*1; } else if(b>a>c) { cout<<'3'<<endl; cout<<b*100+a*10+c*1; } else if(b>c>a) { cout<<b*100+c*10+a*1; } else if(c>b>a) { cout<<c*100+b*10+a*1; } else if(c>a>b) { cout<<c*100+a*10+b*1; } else { cout<<'7'<<endl; cout<<a*100+b*10+c*1; } return 0; }
Information
- ID
- 36
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 1
- Tags
- (None)
- # Submissions
- 196
- Accepted
- 55
- Uploaded By