CLS
INPUT "vvedite kolichestvo elementov 1 mnojestva M ", m 'predvaritelno vvodim chislo elementov
DIM A(m)
INPUT "vvedite kolichestvo elementov 2 mnojestva N ", n 'predvaritelno vvodim chislo elementov
DIM B(n)
FOR i = 1 TO m 'zapolnyayu chislami ot 20 do 50 s klavi
INPUT "vvedite element 1 mnojestva ", A(i)
NEXT
FOR i = 1 TO n 'zapolnyayu chislami ot 20 do 50 s klavi
INPUT "vvedite element 2 mnojestva ", B(i)
NEXT
PRINT "1 mnojestvo"
FOR i = 1 TO m
PRINT A(i);
NEXT
PRINT
PRINT "2 mnojestvo"
FOR i = 1 TO n
PRINT B(i);
NEXT
PRINT
IF m > n THEN PRINT " v pervom bolshe" ELSE PRINT "vo vtorom bolshe" 'Opredelyayu, v kakom iz mnozhestv menshe elementov
FOR i = 1 TO m 'nakhozhu summu elementov, potom delyu na ikh kolichestvo, poluchayu srednee arifmeticheskoe ,nu pokraine mere na slovakh
s1 = s1 + A(i)
NEXT
z = s1 / m
PRINT "srednee arifmeticheskoe 1 mnojestva= "; z
FOR i = 1 TO n
s2 = s2 + B(i)
NEXT
w = s1 / n
PRINT "srednee arifmeticheskoe 2 mnojestva= "; w
Тестирование выполнено в программе QB64 ( Скачать )