CLS
INPUT "Razmernost massiva="; n
DIM a(n)
PRINT "Vvedite elementi massiva"
FOR i = 1 TO n
INPUT a(i)
NEXT i
PRINT "Massiv a"
FOR i = 1 TO n
PRINT a(i);
NEXT i
PRINT
s = 0: k = 0
FOR i = 1 TO n
v = 0
FOR q = 1 TO n
IF i <> q THEN
IF a(i) = a(q) THEN v = 1
END IF
NEXT q
IF v = 0 THEN s = s + a(i): k = k + 1
NEXT i
IF k > 0 THEN
sr = s / k
PRINT "Sredneye arifmetich nepovtor elementov="; sr
ELSE
PRINT "Vse elementi massiva odinakovi"
END IF
Тестирование выполнено в программе QB64 ( Скачать )