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]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.
program tim_dien_tich;
uses crt;
var a1,a2,b1,b2,x1,x2,i,dem:longint;
dtnn,dt1,dt2,dt3,dt4,dt5,dt6:real;
x3:array[1..1000]of longint;
dt:array[1..1000]of real;
begin
clrscr;
write('nhap chieu dai va chieu rong:');readln(a1,b1);
a2:=a1;b2:=b1;dt1:=a1*b1;dt2:=dt1/2;
x1:=0;i:=0;dem:=0;
writeln(dt2:5:1);
writeln(x1);
while x1<b1 do
begin
dt3:=a2*x1/2;
dt4:=(b2-x1)*x1/2;
dt5:=b2*(a2-x1)/2;
dt6:=dt1-dt3-dt4-dt5;
dt[i]:=dt6;x3[i]:=x1;
x1:=x1+1;i:=i+1;dem:=dem+1;
end;
dtnn:=dt[1];
for i:=1 to dem do
begin
if (dtnn>dt[i])and(dt[i]<>0) then dtnn:=dt[i];
end;
writeln(dtnn:5:1);
for i:=1 to dem do
if dtnn=dt[i] then writeln(x3[i]);
readln;
end.
Uses crt;
var i,n,y: integer;
begin clrscr;
readln(n);
for i:=1 to n do s:=i*i;
Writeln(s);
readln;
end.
Var a:array[1..1000] of integer;
s:longint;
i,n:integer;
Begin
s:=1;
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i);readln(a[i]);
s:=s*a[i];
End;
Write('Tich la ',s);
Readln
End.
program TinhTich;
var n, i, tich: integer;
begin
write('Nhap vao n: ');
readln(n);
tich := 1;
for i := 1 to n do
tich := tich * i;
writeln('tich cua ', n, ' so tu nhien dau tien la: ', tich);
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.