C语言实验——各位数字之和排序
Time Limit: 1000MS Memory Limit: 65536KB
Problem Description
给定n个正整数,根据各位数字之和从小到大进行排序。
Input
输入数据有多组,每组数据占一行,每行的第一个数正整数n,表示整数个数,后面接n个正整数。当n为0时,不作任何处理,输入结束。n<=10
Output
输出每组排序的结果。
Example Input
2 1 2
3 121 10 111
0
Example Output
1 2
10 111 121
Hint
Author
#include <stdio.h>
int sum(int n);
int main ()
{
int n , s[11] , i , t , m[11];
while (scanf ("%d" , &n)!=EOF&&n!=0)
{
for ( i = 0 ; i < n ; i++)
{
scanf (