Huawei trial-sorting by integer array (string input and output) and Huawei Input and Output
# Include <stdio. h>/* compile a program to implement the sorting algorithm. The user enters the certificate sequence. The program sorts all the certificates from small to large and outputs the input: number sequence. The length is less than 1024, the two numbers are separated by commas. All numbers are non-negative integers. The number of integers is less than 128. Output: The sorted integer sequence. The two numbers are separated by commas. */int main (int argc, char * argv []) {int a [129]; int I = 0; scanf ("% d", & a [I ++]); char c; while (scanf ("% c", & c) & c! = '\ N') {scanf ("% d", & a [I]); I ++;} for (int j = 0; j <I; ++ j) for (int k = j + 1; k <I; ++ k) {if (a [j]> a [k]) {int t = a [j]; a [j] = a [k]; a [k] = t;} printf ("% d ", a [0]); for (int k = 1; k <I; ++ k) printf (", % d", a [k]); printf ("\ n"); return 0 ;}