Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
uses crt;
var a:array[1..100,1..100]of integer;
i,n,m,j:integer;
begin
clrscr;
readln(n,m);
for i:=1 to n do
for j:=1 to m do
readln(a[i,j]);
readln;
end.
Program HOC24;
var i,n: integer;
a: array[1..1000] of integer;
function nt(x: integer): boolean;
var j: integer;
begin
nt:=true;
if (x=2) or (x=3) then exit;
nt:=false;
if (x=1) or (x mod 2=0) or (x mod 3=0) then exit;
j:=5;
while j<=trunc(sqrt(x)) do
begin
if (x mod j=0) or (x mod (j+2)=0) then exit;
j:=j+6;
end;
begin
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:=1 to n do if nt(a[i]) then write(a[i],' ');
readln
end.
uses crt;
var a,b:integer;
begin
clrscr;
readln(a,b);
if (a<0) then writeln(a,' la so am')
else if (a>0) then writeln(a,' la so duong')
else writeln(a,' khong la so am cung khong la so duong');
if (b<0) then writeln(b,' la so am')
else if (b>0) then writeln(b,' la so duong')
else writeln(b,' khong la so am cung khong la so duong');
if (a>0) then writeln(sqr(a+b));
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,ln:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do if (a[i] mod 2=0) then write(a[i]:4);
writeln;
ln:=a[1];
for i:=1 to n do
if ln<a[i] then ln:=a[i];
writeln(ln);
readln;
end.
Bài 4
uses crt;
var a,b: integer;
c,s,d:real;
begin
clrscr;
readln(a,b);
if (a>0) and (b>0) then
begin
c:=sqrt(a*a+b*b);
d:=(a+b+c)/2;
s:=sqrt(d*(d-a)*(d-b)*(d-c));
writeln(c:4:2,' ',s:4:2);
end
else writeln('nhap lai');
readln
end.
Bài 5
uses crt;
var r: integer;
s,t: real;
begin
clrscr;
readln(r);
s:=r*r*3.14;
t:=2*3.14*r;
writeln(s:4:2,' ',t:4:2);
readln
end.
uses crt;
var a:array[1..100]of integer;
i,n,t,dem:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
dem:=0;
t:=0;
for i:=1 to n do
begin
if a[i] mod 3=0 then dem:=dem+1;
end;
for i:=1 to n do t:=t+a[i];
writeln('So phan tu chia het cho 3 la: ' ,dem);
writeln('Tong cac so la: ',t);
readln;
end.