Ответ(ы) на вопрос:
Гость
DIM a(1 TO 10)
CLS
RANDOMIZE (TIMER)
DIM p AS LONG
p = 1
FOR i = 1 TO 10
a(i) = CINT(10 * RND + 11)
PRINT a(i);
IF a(i) < 14 THEN p = p * a(i)
NEXT i
PRINT
PRINT "P="; p
DIM a(1 TO 10)
CLS
RANDOMIZE (TIMER)
k = 0
FOR i = 1 TO 10
a(i) = CINT(21 * RND - 11)
PRINT a(i);
IF a(i) >= -3 AND a(i) <= 3 THEN k = k + 1
NEXT i
PRINT
PRINT "k="; k
DIM a(1 TO 10)
CLS
RANDOMIZE (TIMER)
s = 0
FOR i = 1 TO 10
a(i) = CINT(21 * RND - 11)
PRINT a(i);
IF a(i) < 0 AND i MOD 2 <> 0 THEN s = s + a(i)
NEXT i
PRINT
PRINT "s="; s
Не нашли ответ?
Похожие вопросы