Var ar:array[1..10] of integer; i,s:integer; begin; for i:=1 to 10 do readln(ar[i]); writeln('OK:'); for i:=1 to 10 do if (i mod 2=0) and (ar[i] mod 2=0) then writeln(ar[i]); end.
int main() { int n=10, i, s=0; int a[n]; srand(time(NULL)); cout<<"array:"<<endl; for (i=0; i<n; i++) { a[i]=rand() % 50; cout<<a[i]<<" "; } cout<<endl; i = 1; do { a[i] = a[i]*a[i]; s += a[i]; i += 2; } while (i<=n);
for (i=0; i<n; i++) cout<<a[i]<<" "; cout<<endl; cout << "s = " << s << endl; return(0); }
i,s:integer;
begin;
for i:=1 to 10 do
readln(ar[i]);
writeln('OK:');
for i:=1 to 10 do
if (i mod 2=0) and (ar[i] mod 2=0) then writeln(ar[i]);
end.