Pascal:
var a:array [1..30] of integer;
i:integer;
p:longint;
begin
p:=1;
randomize;
a[1]:=random(21)+50;
for i:=2 to 29 do a[i]:=random(100);
a[30]:=random(21)+50;
for i:=1 to 30 do write (a[i],' ');
writeln;
for i:=1 to 30 do
if (a[i] in [10..99]) and (a[i] mod 2 = 0) and ((a[i] div 10) in [5..7]) then p:=p*a[i];
writeln ('Proizvedenie: ',p);
readln;
end.
C++:
#include
#include
#include
using namespace std;
int main()
{
int a[30],i;
unsigned long long p = 1;
srand (time(NULL));
a[0] = rand()%70+50;
for (i = 1; i<29; i++)<br> a[i] = rand()%100;
a[29] = rand()%7+50;
for (i = 0; i<30; i++)<br> {
cout <<a[i] <<" ";<br> if ((a[i]/10==5 || a[i]/10==6 || a[i]/10==7) && (a[i]>9 && a[i]<100) && a[i]%2==0)<br> p*=a[i];
}
cout <<endl;<br> cout <<"Proizvedenie: " <<p <<endl;<br> return 0;
}