Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
20663 桑迪 调整三位数,使其值最大 C++ Accepted 100 0 MS 252 KB 227 2021-06-19 17:10:25

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int sw,g,s,b,t; int main(){ cin>>sw; g=sw%10; s=(sw/10)%10; b=sw/100; if(b<s) t=b,b=s,s=t; if(b<g) t=b,b=g,g=t; if(s<g) t=g,g=s,s=t; cout<<b<<s<<g; return 0; }


Judgement Protocol: