CLS
DO
INPUT "vvedite n "; n
LOOP UNTIL n <= 10
DIM a(n + 1), b(n + 1, n + 1)
FOR i = 1 TO n
INPUT "vvedite element ", a(i)
NEXT
PRINT "ishodnyj massiv"
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
FOR i = 1 TO n
FOR j = 1 TO n - i + 1
b(i, j) = a(j - 1 + i)
NEXT
FOR j = n - i + 2 TO n
b(i, j) = a(j - 1 + i - n)
NEXT
NEXT
PRINT "novyj massiv"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT b(i, j);
NEXT
PRINT
NEXT
CLS
Again: INPUT "Vvedite N:", N
IF N >= 10 OR N < 1 GOTO Again 'Ограничение ввода
DIM A(N, N)
DATA 1,2,3,4,5,6,7,8,9 'Линейная матрица
' Заполним 1-ю строку (это и будет по сути линейной матрицей)
FOR ix = 1 TO N
READ A(ix, 1)
NEXT
' Копируем из первой в последующие со сдвигом
FOR iy = 2 TO N: FOR ix = 1 TO N
NewX = (ix - 2 + iy) MOD N + 1 'Откуда брать эл-т
A(ix, iy) = A(NewX, 1)
NEXT: NEXT
' Результат
FOR iy = 1 TO N: FOR ix = 1 TO N
PRINT A(ix, iy);
NEXT: PRINT : NEXT
CLS
n = 10
DIM a(n)
DATA 1,2,3,4,5,6,7,8,9,10
FOR i = 1 TO n: READ a(i): NEXT
FOR i = 1 TO n
q = i
FOR j = 1 TO n
PRINT a(q);
q = q + 1
IF q > n THEN q = 1
NEXT
PRINT
NEXT
Тестирование выполнено в программе QB64 ( Скачать )