DIM A(9) As Integer DIM i As Integer DIM j As Integer DIM buff As Integer DIM count As Integer = 0 A(0)=5 A(1)=3 A(2)=4 A(3)=2 A(4)=1 A(5)=6 A(6)=3 A(7)=2 A(8)=4 For j=0 to 8 For i = 0 to 7 if A(i)>A(i+1) Then buff=A(i) A(i)=A(i+1) A(i+1)=buff End If Next Next For i = 0 to 7 print A(i) if A(i) <> A(i+1)then count=count+1 end if Next print A(8) print "Count: ";Count
Comments
0 B
|👍
/👎
0 B
|👍
/👎