1)
Program b1;
Var a:array[1..100] of integer;
i,n,d,min:integer;
Function ngto(c:longint):boolean;
Var b:longint;
Begin
If c<2 then ngto:=false else ngto:=true;
For b:=2 to trunc(sqrt(c)) do
if c mod b = 0 then
begin
ngto:=false; break;
end;
End;
Begin
{---cau_a----}
Writeln('Nhap n:');Readln(n);
Writeln('Cac so trong day la: ');
For i:=1 to n do
Begin
Write('a[',i,']=');Readln(a[i]);
end;
{---cau_b---}
For i:=1 to n do
If ngto(a[i]) then d:=d+1;
writeln ('Co ',d,' so nt trong day');
{---cau_c---}
min:=a[1];
For i:=1 to n do
If a[i]<min then min:=a[i];
write ('So nho nhat la ',min);
Readln
End.
2)
Program b2;
Var s,s1:string;
i:integer;
Begin
write('Nhap xau : ');readln(s);
for i:= (length(s)) downto 1 do
S1:=S1+S[i];
if (S1=S) then write('Xau doi xung') else writeln('Xau khong doi xung');
write ('Xau sau khi in hoa la: ');
For i:=1 to length(s) do
s[i]:=upcase(s[i]);
Write(s);
readln;
END.