Những câu hỏi liên quan
Cún đi hỏi bài
Xem chi tiết
Nguyễn Lê Phước Thịnh
9 tháng 5 2021 lúc 20:36

uses crt;

var a,b:integer;

{-------------------thu-tuc-nhap-------------------}

procedure nhap(var n:integer);

begin

write('Nhap so tu nhien:'); readn(n);

end;

{---------------------ham-tinh-tong----------------------}

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

begin

tong:=x+y;

end;

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

begin

clrscr;

nhap(a);

nhap(b);

writeln(tong(a,b));

readln;

end.

Bình luận (0)
Đồng Trung
Xem chi tiết
❄️Ꭵᑕᗴ❄️
13 tháng 4 2021 lúc 21:48

program Angus;
uses crt;
var 
    x1,x2,x3,y1,y2,y3,s,p,n,a,b,c :real;
begin
        clrscr;
        write('Nhập tọa độ điểm A(x1,y1)= '); readln(x1,y1);
        write('Nhập tọa độ điểm B(x2,y2)= '); readln(x2,y2);
        write('Nhập tọa độ điểm C(x3,y3)= '); readln(x3,y3);
a:=sqrt(sqr(x2-x1)+sqr(y2-y1));
b:=sqrt(sqr(x3-x2)+sqr(y3-y2));
c:=sqrt(sqr(x1-x3)+sqr(y1-y3));
if (a+b>c) and (b+c>a) and (c+a>b) then
        begin
                p:=a+b+c;
                n:=p/2;
                s:=sqrt(n*(n-a)*(n-b)*(n-c));
        writeln('Chu vi = ', p:0:2);
        writeln('Diện tích = ',s:0:2);
        end
else writeln('các điểm bạn vừa nhập không tạo thành 1 tam giác :> ');
readln

Bình luận (0)
hà nội 123
Xem chi tiết
Nguyễn Lê Phước Thịnh
13 tháng 5 2021 lúc 16:59

1:

function dt(r:real):real;

begin

dt:=sqr(r)*pi;

end;

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

2:

function dt(a,b:real):real;

begin

dt:=1/2*a*b;

end;

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

3:

function dt(a,b,c:real):real;

var p,s:real;

begin

p:=(a+b+c)/2;

s:=sqrt(p*(p-a)*(p-b)*(p-c));

dt:=s;

end;

Bình luận (0)
Vũ Hoàng
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 4 2021 lúc 20:49

Mình viết chương trình chính thôi, bạn tự viết chương trình con nhé

uses crt;

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

i,n,t,tam,j:integer;

begin

clrscr;

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

for i:=1 to n do

 begin

write('A[',i,']='); readln(a[i]);

end;

t:=0;

for i:=1 to n do 

  t:=t+a[i];

writeln('Tong diem cua ',n,' ban la: ',t);

for i:=1 to n-1 do

  for j:=i+1 to n do 

if a[i]>a[j] then 

begin

tam:=a[i];

a[i]:=a[j];

a[j]:=tam;

end;

for i:=1 to n do 

  write(a[i]:4);

readln;

end.

Bình luận (0)
Trong nhóm zalo
Xem chi tiết
lenguyenchihieu
Xem chi tiết
Minh Lệ
10 tháng 5 2023 lúc 20:50

Program HOC24;

var t: longint;

a,b: integer;

function gt(x: integer): longint;

var i: integer; tich: longint;

begin

tich:=1;

for i:=1 to n tich:=tich*i;

gt:=tich;

end;

begin

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

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

t:=gt(a)+gt(b)+gt(a-b);

write('T = ',t);

readln

end.

Bình luận (3)
Tuấn Lê
Xem chi tiết
Trần Nam Khánh
19 tháng 5 2021 lúc 8:47

<bits/stdc++.h>
using namespace std;
int DTT(int a, int b, int c)

   int m = sqrt(2*b*b+2*c*c-a*a)/2;
    return m;

int main()
int a, b, c, m;
    cout << "Nhap ba canh tam giac" << endl;
    cin >> a >> b >> c;
    m = DTT(a,b,c);
    cout << m;
    return 0;

end.
 

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

uses crt;

var a,b,c:real;

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

function ttuyen(x,y,z:real):integer;

begin

ttuyen:=(2*(sqr(ab)+sqr(ac))-sqr(bc));

end;

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

begin

clrscr;

repeat

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

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

write('c='); readln(c);

until (a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and (b+c>a);

writeln(sqrt(ttuyen(a,b,c))/4:4:2);

readln;

end.

Bình luận (0)
Kiều My
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 6 2020 lúc 22:10

procedure nhap(x,y:integer);

begin

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

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

end;

Bình luận (0)
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)