#include <stdio.h> int main() { int a[10], t; int i, j, max; printf("请输入10个数: "); for (i = 0; i <= 9; i=i+1) scanf_s("%d", a+i); for (j = 9; j >=0; j = j-1) { max = j; for (i = 0; i <=j; i = i + 1) { if (a[max] <= *(a+i)) max = i; if (max != j) { t = a[max]; a[max] = *(a+j); *(a+j) = t; } } } for (i = 0; i <= 9; i=i+1) printf("%-3d",*(a+i)); }