Những câu hỏi liên quan
Kiệt Bùi
Xem chi tiết
Hoàng Thị Minh Tuyết
Xem chi tiết
Nya arigatou~
Xem chi tiết
Nya arigatou~
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 4 2021 lúc 13:16

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.

Bình luận (0)
Felix MC-Gamer
Xem chi tiết
phạm quang huy
Xem chi tiết
phạm quang huy
4 tháng 8 2021 lúc 12:41

giúp mình với

Bình luận (0)
Anh Phạm
5 tháng 8 2021 lúc 18:02

xàm hả cha

 

Bình luận (0)
Anh Phạm
5 tháng 8 2021 lúc 18:02

đề ko có bất kì thứ gì mà kêu in ra?
 

Bình luận (0)
phạm quang huy
Xem chi tiết
Phan Thị Thùy Ngân
Xem chi tiết
Nguyễn Lê Phước Thịnh
2 tháng 5 2021 lúc 22:29

Câu 2: 

uses crt;

var a,b:integer;

{-----------------chuong-trinh-con-------------------}

function ucln(x,y:integer):integer;

var i,uc:integer;

begin

if x<y then 

begin

uc:=1;

for i:=1 to x do 

  if (x mod i=0) and (y mod i=0) then  

begin

if uc<i then uc:=i;

end;

end

else begin

uc:=1;

for i:=1 to y do 

  if (x mod i=0) and (y mod i=0) then  

begin

if uc<i then uc:=i;

end;

end;

ucln:=uc;

end;

{--------------------------chuong-trinh-chinh------------------------}

begin

clrscr;

write('Nhap a='); readln(a);

write('Nhap b='); readln(b);

writeln(a,'/',b,'=',a div ucln(a,b),'/',b div ucln(a,b));

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
2 tháng 5 2021 lúc 22:30

Câu 1: 

const fi='songuyen.inp'

fo='tong.out'

var f1,f2:text;

a:array[1..100]of integer;

i,n,t:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

n:=0;

while not eoln(f1) do 

  begin

n:=n+1;

read(f1,a[n]);

end;

t:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then t:=t+a[i];

writeln(f2,t);

close(f1);

close(f2);

end.

Bình luận (0)
Ngô Chí Thành
Xem chi tiết
Nguyễn Lê Phước Thịnh
11 tháng 4 2021 lúc 17:59

const fi1='nguyen1.txt'

fi2='nguyen2.txt'

fo='nguyen.txt'

var f1,f2,f3:text;

a,b:array[1..100]of integer;

n,m,i:integer;

begin

assign(f1,fi1); reset(f1);

assign(f2,fi2); reset(f2);

assign(f3,fo); rewrite(f3);

n:=0;

while not eof(f1) do 

  begin

inc(n);

readln(f1,a[n]);

end;

m:=0;

while not eof(f2) do 

begin

m:=m+1;

readln(f1,b[m]);

end;

for i:=1 to n do 

 writeln(f3,a[i]);

for i:=1 to m do 

  writeln(f3,b[i]);

close(f1);

close(f2);

close(f3);

end.

Bình luận (0)