#include #include using namespace std; int main() { int a[3]; cin >> a[0] >> a[1] >> a[2]; sort(a, a + 3); // sort默认升序 cout << a[0] << "->" << a[1] << "->" << a[2]; return 0; }

用c++编写程序本题要求将输入的任意3个整数从小到大输出。输入格式输入在一行中给出3个整数其间以空格分隔。输出格式在一行中将3个整数从小到大输出其间以-相连。输入样例4 2 8输出样例2-4-8

原文地址: http://www.cveoy.top/t/topic/hulw 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录