Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
Anh Thư Nguyễn
Xem chi tiết
Minh Hoạt
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 4 2021 lúc 20:54

Câu 1: 

uses crt;

const fi='bai1.inp'

var f1:text;

a,b:real;

begin

clrscr;

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

readln(f1,a,b);

writeln(a*b:4:2);

close(f1);

readln;

end.

Nguyễn Lê Phước Thịnh
23 tháng 4 2021 lúc 20:57

Câu 2: 

const fi='bai2.inp'

fo='bai2.out'

var f1,f2:text;

a,b:real;

begin

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

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

readln(f1,a,b);

writeln(f2,a*b:4:2);

close(f1);

close(f2);

end.

Nguyễn Lê Phước Thịnh
23 tháng 4 2021 lúc 20:57

Câu 3: 

const fi='bai3.inp'

fo='bai3.out'

var f1,f2:text;

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

i,n:integer;

begin

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

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

n:=0;

while not eof(f1) do 

  begin

n:=n+1;

readln(f1,a[n],b[n]);

end;

for i:=1 to n do  

  writeln(f2,a[i]*b[i]:4:2);

close(f1);

close(f2);

end.

U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
Louis Kai
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.

Nya arigatou~
Xem chi tiết