Pascal: var a:array [1..10] of integer; i:integer; begin for i:=1 to n do begin write ('A[',i,'] = '); readln (a[i]); end; for i:=1 to 10 do if a[i] mod 2 = 1 then write (a[i],' '); end.
C++: #include <iostream> using namespace std;
int main() { int a[10]; for (int i = 0; i<10; i++) { cout <<"A[" <<i <<"] = '"; cin >>a[i]; } for (int i = 0; i<10; i++) if (a[i]%2==1) cout <<a[i] <<" "; return 0; }
var a:array [1..10] of integer;
i:integer;
begin
for i:=1 to n do
begin
write ('A[',i,'] = ');
readln (a[i]);
end;
for i:=1 to 10 do
if a[i] mod 2 = 1 then write (a[i],' ');
end.
C++:
#include <iostream>
using namespace std;
int main()
{
int a[10];
for (int i = 0; i<10; i++)
{
cout <<"A[" <<i <<"] = '";
cin >>a[i];
}
for (int i = 0; i<10; i++)
if (a[i]%2==1)
cout <<a[i] <<" ";
return 0;
}