```cpp
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
int main(){
int a,b,c,t,A,B,C;
cin>>a>>b>>c;
A=a;
B=b;
C=c;
if(a>b){
t=a;
a=b;
b=t;
}
if(a>c){
t=a;
a=c;
c=t;
}
if(b>c){
t=b;
b=c;
c=t;
}
printf("%d\n%d\n%d\n",a,b,c);
printf("\n%d\n%d\n%d\n",A,B,C);
return 0;
}
法二 加了algorithm头文件,可以运用swap和reverse等函数
include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
int main(){
int a,b,c,t,A,B,C;
cin>>a>>b>>c;
A=a;
B=b;
C=c;
if(a>b){
swap(a,b);
}
if(a>c){
swap(a,c);
}
if(b>c){
swap(b,c);
}
printf("%d\n%d\n%d\n",a,b,c);
printf("\n%d\n%d\n%d\n",A,B,C);
return 0;
}