编程实现3个数排序:用户键盘上输入3个整型数据输出结果为从小到大排序输出输出数据间隔1个英文空格。例如:输入格式:34 48 3输出格式:3 34 48 注意:数据中间一个英文空格c语言
#include <stdio.h>
int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); if (a > b) { int temp = a; a = b; b = temp; } if (b > c) { int temp = b; b = c; c = temp; } if (a > b) { int temp = a; a = b; b = temp; } printf("%d %d %d", a, b, c); return 0; }
原文地址: http://www.cveoy.top/t/topic/biLn 著作权归作者所有。请勿转载和采集!