DECLARE SUB umnog (c!(), n AS INTEGER)
CLS
DIM SHARED n AS INTEGER
INPUT "Razmernost massivov="; n
DIM a(n), b(n)
PRINT
RANDOMIZE TIMER
PRINT "Ishodniy perviy massiv"
FOR i = 1 TO n
a(i) = INT(RND * 101) - 50
PRINT a(i);
NEXT i
PRINT: PRINT
PRINT "Ishodniy vtoroy massiv"
FOR i = 1 TO n
b(i) = INT(RND * 101) - 50
PRINT b(i);
NEXT i
PRINT
DIM k AS INTEGER
PRINT
INPUT "k="; k
CALL umnog(a(), k)
CALL umnog(b(), k)
PRINT
PRINT "Perviy massiv posle preobrazovaniy"
FOR i = 1 TO n
PRINT a(i);
NEXT i
PRINT: PRINT
PRINT "Vtoroy massiv posle preobrazovaniy"
FOR i = 1 TO n
PRINT b(i);
NEXT i
SUB umnog (c(), k AS INTEGER)
FOR i = 1 TO n
IF i MOD 2 = 1 THEN c(i) = c(i) * k
NEXT i
END SUB
Тестирование выполнено в программе QB64 ( Скачать )