This is one of the most widely used sorting methods in the past, and today I am still thinking about what is the choice of sorting... I can imagine how hard my foundation is to be played...
# Include <stdio. h> # include <string. h> # include <math. h> # include <iostream> # include <algorithm> # include <string> # define INF 0x3fffffffusing namespace STD; int N; int A [1000]; void dir_choose () {for (INT I = 0; I <n-1; I ++) // This is the legendary direct sorting. it's fun. A simple sorting. {for (Int J = I + 1; j <n; j ++) {if (a [I]> A [J]) {int T = A [I]; A [I] = A [J]; A [J] = T ;}}} int main () {cout <"input the number that you want be sorted: "<Endl; CIN> N; cout <" input the numbers: "<Endl; For (INT I = 0; I <n; I ++) {CIN> A [I];} dir_choose (); For (INT I = 0; I <n; I ++) {cout <A [I] <";}cout <Endl; System (" pause "); Return 0 ;}