Report problem-solving - the string / bubble sort sort English words

Problem-solving ideas: For a number of English words entered by comparing the bubble sort will eventually English words small to large output.
Input:

(1) the total number of English words no more than 20, the English word is less than the string length input 10 is achieved by a two-dimensional array.
(2) by a first input string str dimensional array, while determining whether the '#' is the out of the loop, if the call is strcpy function to assign str op.
Sort:

(1) Since the n is the number of the input character string, so the number of outer loop needs to n-1.
(2) subject of the request is to determine the string length, the length of calls strlen function to compare the size of the front and rear two strings.
If the length of the former than the latter, then two strings of exchange positions, to achieve exchange call strcpy string.
Output: string array using cycle-by output after sorting, the subject noted format requirements.

Guess you like

Origin www.cnblogs.com/thilr/p/12053134.html