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 nhap_tinhtong;
uses crt;
type kmang=array[1..1000] of integer;
var A:kmang;
n:integer;
{---Nhap---}
procedure nhap;
var i:integer;
begin
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']= '); readln(A[i]);
end;
end;
{---Tinh-tong---}
function tinh_tong(A:kmang; n:integer):integer;
var t,i:integer;
begin
t:=0;
for i:=1 to n do
t:=t+A[i];
tinh_tong:=t;
end;
{---CT-chinh---}
BEGIN
clrscr;
nhap;
write('Tong cac phan tu la: ',tinh_tong(A,n));
readln;
end.
program nhap_tinhtong;
uses crt;
type kmang=array[1..1000] of integer;
var A:kmang;
n:integer;
{---Nhap---}
procedure nhap;
var i:integer;
begin
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']= '); readln(A[i]);
end;
end;
{---Tinh-tong---}
function tinh_tong(A:kmang; n:integer):integer;
var t,i:integer;
begin
t:=0;
for i:=1 to n do
t:=t+A[i];
tinh_tong:=t;
end;
{---CT-chinh---}
BEGIN
clrscr;
nhap;
write('Tong cac phan tu la: ',tinh_tong(A,n));
readln;
end.
Program HOC24;
var m,n,i: integer;
t1,t2: longint;
begin
write('Nhap m;n: '); readln(m,n);
t1:=1; t2:=1;
for i:=1 to n do t1:=t1*i;
for i:=m to n do t2:=t2*i;
writeln('T1=',t1);
write('T2=',t2);
readln
end.
const fi='tamgiac.dat';
fo='tamgiac.out';
var f1,f2:text;
a,b,c,d,e,f:array[1..100]of integer;
i,n,dem1,dem2,dem3:integer;
ab,bc,ac:real;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n);
for i:=1 to n do
readln(f1,a[i],b[i],c[i],d[i],e[i],f[i]);
dem1:=0;
dem2:=0;
dem3:=0;
for i:=1 to n do
begin
ab:=sqrt(sqr(a[i]-c[i])+sqr(b[i]-d[i]));
ac:=sqrt(sqr(a[i]-e[i])+sqr(b[i]-f[i]));
bc:=sqrt(sqr(c[i]-e[i])+sqr(d[i]-f[i]));
if (ab>0) and (ac>0) and (bc>0) and (ab+ac>bc) and (ab+bc>ac) and
(ac+bc>ab) then
begin
if (ab=ac) or (ac=bc) then inc(dem1);
if ((ab=ac) and (ab<>bc) and (ac<>bc)) then inc(dem2);
if ((ac=bc) and (bc<>ab) and (ac<>ab)) then inc(dem2);
if ((ac=bc) and (ac<>ab) and (bc<>ab)) then inc(dem2);
if sqr(ab)=sqr(ac)+sqr(bc) then inc(dem3);
if sqr(ac)=sqr(bc)+sqr(ab) then inc(dem3);
if sqr(bc)=sqr(ab)+sqr(ac) then inc(dem3);
end;
end;
writeln(f2,dem1);
writeln(f2,dem2);
writeln(f2,dem3);
close(f1);
close(f2);
end.