1,
uses crt;
var a:array[1..250] of longint;
i,j,n,dem:byte;
min,tam:longint;
function nt(x:longint):boolean;
var i:longint;
begin
if x<2 then exit(false);
for i:=2 to trunc(sqrt(x)) do
if x mod i = 0 then exit(false);
exit(true);
end;
begin
clrscr;
repeat
writeln('n = ');readln(n);
until (0<n) and (n<=250);
for i:=1 to n do
begin
write('a[',i,']= ');readln(a[i]);
end;
write('a, ');
for i:=1 to n do
begin
write(a[i],' ');
if nt(a[i])=true then inc(dem);
if a[i]<min then min:=a[i];
end;
writeln;
writeln('b, Co ',dem,' so nguyen to trong day');
writeln('c, GTNN= ',min);
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]<a[j] then
begin
tam:=a[i];a[i]:=a[j];a[j]:=tam;
end;
writeln('d, Day da sap xep:');
for i:=1 to n do write(a[i],' ');
readln;
end.
2,
uses crt;
var st,s:string;
i:byte;
begin
clrscr;
readln(st);
for i:=length(st) downto 1 do
s:=s+st[i];
if s=st then writeln('a, Xau doi xung')
else writeln('a, Xau khong doi xung');
for i:=1 to length(st) do
st[i]:=upcase(st[i]);
writeln('b, ',st);
readln;
end.