K
Khách

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.

uses crt;

var a,b,c:real;

dt:real;

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

procedure nhap(var x,y,z:real);

begin

repeat

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

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

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

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

end;

{-----------------chuong-trinh-con-tinh-dien-tich------------------------}

function dientich(var f,g,h:real):real;

var p:real;

begin

p:=(f+g+h)/2;

dientich:=sqrt(p*(p-f)*(p-g)*(p-h));

end;

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

begin

clrscr;

nhap(a,b,c);

dt:=dientich(a,b,c);

writeln('Dien tich tam giac la: ',dt:4:2);

readln;

end.

uses crt;

var a,b,c,p,s,am,bn,cp:real;

begin

clrscr;

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

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

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

if (a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and (b+c>a) then

begin

writeln('Day la ba canh trong mot tam giac vuong');

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

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

writeln('Dien tich tam giac la: ',s:4:2);

am:=sqrt(2*(sqr(b)+sqr(c))-sqr(a))/4;

bn:=sqrt(2*(sqr(a)+sqr(c))-sqr(b))/4;

cp:=sqrt(2*(sqr(a)+sqr(b))-sqr(c))/4;

writeln('Do dai duong trung tuyen ung voi canh a la: ',am:4:2);

writeln('Do dai duong trung tuyen ung voi canh b la: ',bn:4:2);

writeln('Do dai duong trung tuyen ung voi canh c la: ',cp:4:2);

end

else writeln('Day khong la ba canh trong mot tam giac');

readln;

end.

1:

function dt(r:real):real;

begin

dt:=sqr(r)*pi;

end;

2:

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

begin

dt:=1/2*a*b;

end;

19 tháng 5 2021

<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.
 

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.

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.

#include <bits/stdc++.h>

using namespace std;

double a,b,c,h,p,s;

int main()

{

cin>>a>>b>>c;

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

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

if (s>50) cout<<"Dien tich tam giac lon hon";

else cout<<"Dien tich tam giac nho hon";

return 0;

}

#include <bits/stdc++.h>

using namespace std;

long long a[1000],n,i,dem,t,j,t1;

int main()

{

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

for (i=1; i<=n; i++) cout<<a[i]<<" ";

cout<<endl;

dem=0;

for (i=1; i<=n; i++)

{

t=0;

for (j=1; j<=a[i]-1; j++)

if (a[i]%j==0) t+=j;

if (t==a[i]) dem++;

}

cout<<dem<<endl;

t1=0;

for (i=1; i<=n; i++)

if (a[i]%2==0) t1+=a[i];

cout<<t1;

return 0;

}

25 tháng 5 2022

#include <bits/stdc++.h>

using namespace std;

long long a[1000],n,i,dem,t,j,t1;

int main()

{

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

for (i=1; i<=n; i++) cout<<a[i]<<" ";

cout<<endl;

dem=0;

for (i=1; i<=n; i++)

{

t=0;

for (j=1; j<=a[i]-1; j++)

if (a[i]%j==0) t+=j;

if (t==a[i]) dem++;

}

cout<<dem<<endl;

t1=0;

for (i=1; i<=n; i++)

if (a[i]%2==0) t1+=a[i];

cout<<t1;

return 0;

}

#include <bits/stdc++.h>

using namespace std;

long long a[1000],n,i,dem,t,j,t1;

int main()

{

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

for (i=1; i<=n; i++) cout<<a[i]<<" ";

cout<<endl;

dem=0;

for (i=1; i<=n; i++)

{

t=0;

for (j=1; j<=a[i]-1; j++)

if (a[i]%j==0) t+=j;

if (t==a[i]) dem++;

}

cout<<dem<<endl;

t1=0;

for (i=1; i<=n; i++)

if (a[i]%2==0) t1+=a[i];

cout<<t1;

return 0;

}

10 tháng 5 2023

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.

10 tháng 5 2023

Program HOC24;

var i,n: integer;

t: longint;

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

begin

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 if a[i] mod 2<>0 then t:=t+a[i];

write('Ket qua la: ',t);

readln

end.