Input
Input consists of two lines, the first line, given an integer n, then follow the x1, x2, x3,... , xn (n integer), with a space between number, the second line, given the number 0 or 1 (0 means according to the ascending order, 1 in descending order), (1 & lt;=n<=100, xi<=1000000000, I ∈ (1, n])
Program execution to the end of the file
The Output
For each test sample, the output of the position of the largest number, (position starting from 1, has been to n)
The Sample Input
4 5 4 3 2
0
1
21
2 4 3
0
10 1 3 September 7, 4, 5, 2 10 8 6
1
The Sample Output
4
1
2
1
CodePudding user response:
To search the bubble sort, it is very simpleCodePudding user response:
For (p=0, j=1; JPrint the p
CodePudding user response: