文章目录
- AcWing 663. 简单排序
- AC代码
AcWing 663. 简单排序
本题链接:AcWing 663. 简单排序
本博客给出本题截图:
AC代码
代码:
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int x = a, y = b, z = c; if (b < a) { int t = a; a = b; b = t; } if (c < a) { int t = a; a = c; c = t; } if (c < b) { int t = b; b = c; c = t; } cout << a << endl << b << endl << c << endl << endl; cout << x << endl << y << endl << z << endl; return 0; }