Microsoft qbasic 1.0 dim n as integer cls input "n=", n redim a(1 to n) as integer randomize timer imax = 1 for i = 1 to n a(i) = int(30 * rnd) if a(i) > a(imax) then imax = i print a(i); next print t = a(imax) for i = imax - 1 to 1 step -1 a(i + 1) = a(i) next a(1) = t for i = 1 to n print a(i); next пример n=15 5 16 10 18 11 12 10 26 27 22 20 5 16 18 4 27 5 16 10 18 11 12 10 26 22 20 5 16 18 4