~/$ ./hw
N = 5
10 5 20 15 25
cmd: show
[0] **********
[1] *****
[2] ********************
[3] ***************
[4] *************************
cmd: swap 0 1
cmd: show
[0] *****
[1] **********
[2] ********************
[3] ***************
[4] *************************
cmd: swap 2 3
cmd: show
[0] *****
[1] **********
[2] ***************
[3] ********************
[4] *************************
cmd: quit
|
The program processes the following commands:
-
show: The program shows the data as in the sample run.
-
swap i j:
The program swaps the positions of the ith number and
jth number.
-
quit: The program ends.
|