#include <stdio.h>/* Write a program that implements the sorting algorithm, the user enters the certificate sequence, the program sorts all the certificates from small to large and outputs input: A sequence of numbers, a length of less than 1024, and a comma-delimited number of two digits, All numbers are non-negative integers, the integer number is less than the total output: sorted integer sequence, two numbers 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;}
Huawei machine test-integer array sorting (string input and Output)