/********************************** Date: * Author: sjf0115 * question: 9 degrees OJ Title 17: All employees age order * Source: http://ac.jobdu.com/problem.php? Cid = 1039 & pid = 16 * result: AC * Source: He Haitao: offoffoffer: Typical programming skills for famous enterprise interviewers * conclusion: lead # include <stdio. h> # include <string. h> int ages [1000001]; // age array int main () {int N, I, j, index; const int oldestage = 100; int countage [oldestage]; // Number of people of each age while (scanf ("% d", & N )! = EOF) {// initialize for (I = 0; I <= oldestage; I ++) {countage [I] = 0 ;} // input age for (I = 0; I <n; I ++) {scanf ("% d", & ages [I]); // count the number of people of each age countage [ages [I] ++;} // sort for (I = 0; I <oldestage; I ++) {for (j = 0; j <countage [I]; j ++) {printf ("% d", I) ;}} printf ("\ n ");} return 0 ;}