|
zadach104.BAS |
|
{* Задача104 *}REM basic ' Поиск количества простых чисел в заданном целочисленном массиве из 50 элементовDim a(50)
RANDOMIZE TIMER
For i = 1 To 50
a(i) = INT(RND * 20) + 2
Next
PRINT "massiv"
For i = 1 To 50
PRINT " "; a(i);
Next
For i = 1 To 50
f = 0
If a(i) = 2 Then
k = k + 1
Else
For j = 2 To SQR(a(i))
If a(i) Mod j = 0 Then f = 1
Next
If f = 0 Then k = k + 1
End If
Next
PRINT "prostyh="; k
End
|