#include<iostream>using namespace std;//题目:输入三个整数x,y,z,请把这三个数由小到大输出。void test04(){int x, y, z;cout << "输入三个整数x,y,z" << endl;cin >> x >> y >> z;if (x>y){int t = x;x = y;y = t;}if (x > z){int t = x;x = z;z = t;}if (y > z){int t = y;y = z;z = t;}cout << "将这三个数由小到大输出:" << endl;cout << x << y << z << endl;}int main(){test04();system("pause");return EXIT_SUCCESS;}
运行结果如图: