Pascal: var a:array [1..3] of integer; i:integer; begin for i:=1 to 3 do begin write (i,' element: '); readln (a[i]); end; for i:=3 downto 1 do write (a[i],' '); readln; end.
C++: #include <iostream> using namespace std;
int main() { int a[3]; for (int i = 0; i<=2; i++) { cin >>a[i]; } for (int i = 2; i>=0; i--) cout <<a[i] <<" "; cout <<endl; return 0; }
var a:array [1..3] of integer;
i:integer;
begin
for i:=1 to 3 do
begin
write (i,' element: ');
readln (a[i]);
end;
for i:=3 downto 1 do write (a[i],' ');
readln;
end.
C++:
#include <iostream>
using namespace std;
int main()
{
int a[3];
for (int i = 0; i<=2; i++)
{
cin >>a[i];
}
for (int i = 2; i>=0; i--)
cout <<a[i] <<" ";
cout <<endl;
return 0;
}