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.
program text;
uses crt;
var i:integer;
a,b,c,ha,hb,hc,p,S:real;
X,Y:array[1..3] of integer;
Begin
clrscr;
Writeln('Nhap toa do cac dinh A, B, C:');
for i:= 1 to 3 do readln(X[i],Y[i]);
a:=sqrt(sqr(X[2]-X[3])+sqr(Y[2]-Y[3]));
b:=sqrt(sqr(X[1]-X[3])+sqr(Y[1]-Y[3]));
c:=sqrt(sqr(X[2]-X[1])+sqr(Y[2]-Y[1]));
p:= (a+b+c)/2;
S:= sqrt(p*(p-a)*(p-b)*(p-c));
Writeln('Dien tich cua tam giac la: ',S:0:4);
ha:=2*S/a;
hb:=2*S/b;
hc:=2*S/c;
writeln('ha = ',ha:0:2,' hb = ',hb:0:2,' hc = ',hc:0:2);
readln;
end.
program bai1;
var
begin
write('Ten cua ban la ');readln(ten);
write('Nam hien tai la ');readln(nht);
write('Nhap nam sinh ');readln(ns);
write('Ban hoc lop ');readln(lop);
tuoi:=nht-ns;
writeln('Ten cua ban la ',tuoi);
readln
end.
uses crt;
var xa,ya,xb,yb,xc,yc,p,s,ab,bc,ac:real;
begin
clrscr;
readln(xa,ya,xb,yb,xc,yc);
ab:=sqrt(sqr(xa-xb)+sqr(ya-yb));
ac:=sqrt(sqr(xa-xc)+sqr(ya-yc));
bc:=sqrt(sqr(xb-xc)+sqr(yb-yc));
p:=(ab+bc+ac)/2;
s:=sqrt(p*(p-ab)*(p-ac)*(p-bc));
writeln(s:4:2);
readln;
end.
1/
program uoc;
uses crt;
var n,i,dem,x:word;
a:array[1..20] of longint;
begin
clrscr;
write('nhap so phan tu cua day:') ;readln(n);
while n>20 do
begin
write('nhap lai so phan tu thoa man toi da la 20 phan tu:');
readln(n);
end;
writeln('nhap cac phan tu cua mang:');
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
write('nhap so nguyen x:'); readln(x);
dem:=0;
for i:=1 to n do
if x mod a[i] =0 then
begin
dem:=dem+1;
writeln(a[i],' la uoc cua ',x);
end;
if dem=0 then writeln('khong co phan tu la uoc cua ',x)
else write('co ',dem,' phan tu la uoc cua ',x);
readln;
end.
uses crt;
var i,n:integer;
s:real;
begin
clrscr;
n:=1;
s:=0;
while (n<=10000) do
begin
n:=n+2;
s:=s+1/n;
end;
writeln(s:4:2);
readln;
end.
const fi='songuyen.inp';
fo='tong.out';
var f1,f2:text;
a:array[1..100]of integer;
n,i,dem:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
n:=0;
while not eof(f1) do
begin
n:=n+1;
read(f1,a[n]);
end;
dem:=0;
for i:=1 to n do
if a[i] mod 2=0 then inc(dem);
writeln(f2,dem);
close(f1);
close(f2);
end.
uses crt;
var xa,ya,xb,yb,xc,yc,p,s,ab,bc,ac:real;
begin
clrscr;
readln(xa,ya,xb,yb,xc,yc);
ab:=sqrt(sqr(xa-xb)+sqr(ya-yb));
ac:=sqrt(sqr(xa-xc)+sqr(ya-yc));
bc:=sqrt(sqr(xb-xc)+sqr(yb-yc));
p:=(ab+bc+ac)/2;
s:=sqrt(p*(p-ab)*(p-ac)*(p-bc));
writeln(s:4:2);
readln;
end.