1.uses crt;
var a:array[1..1000000]of longint; i,n,tc,l,tam,t,j:longint;
begin
clrscr;
write('n=');readln(n);
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
if a[i] mod 2=0 then inc(tc,a[i]);
if a[i] mod 3=0 then inc(l);
inc(t,a[i]);
end;
writeln('a)');
for i:=1 to n do write(a[i],' '); writeln;
writeln('b) ',tc);
writeln('c) ',l);
writeln('d) ',t/n:0:2);
writeln('e) ');
for i:=1 to n do
for j:=1 to i do
if a[j]>a[i] then
begin
tam:=a[j];
a[j]:=a[i];
a[i]:=tam;
end;
for i:=1 to n do write(a[i],' '); writeln;
for i:=1 to n do write(a[n-i+1],' ');writeln;
readln
end.
3.uses crt;
var s:string; i:longint;
begin
clrscr;
write('s=');readln(s);
writeln('a) ',length(s));
writeln('b) ',s);
writeln('c) ');
for i:=1 to length(s) do write(s[length(S)-i+1]);
readln
end.
3.uses crt;
var s:string; i:longint;
begin
clrscr;
write('s=');readln(s);
writeln('a) ',length(s));
writeln('b) ',s);
writeln('c) ');
for i:=1 to length(s) do write(s[length(S)-i+1]);
readln
end.