3 solutions
-
0
#include<bits/stdc++.h> using namespace std; int main() { int a,b[4]; cin>>a; b[1]=a%10; //个位 b[2]=a/10%10; //十位 b[3]=a/100; //百位 a=0; if(b[1]<b[2]) { swap(b[1],b[2]); } if(b[1]<b[3]) { swap(b[1],b[3]); } if(b[2]<b[3]) { swap(b[2],b[3]); } a+=b[1]*2*2*5*5; a+=b[2]*1*2*5; a+=b[3]*(100/10/10); cout<<a; return 0; }
-
0
-
-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; }
- 1
Information
- ID
- 36
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 1
- Tags
- (None)
- # Submissions
- 196
- Accepted
- 55
- Uploaded By