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.

10 tháng 8 2023

#include <iostream>

#include <iomanip>

int main() {

     int r;

     std::cin >> r;

     double pi = 3.14;

     double perimeter = 2 * pi * r;

     double area = pi * r * r;

     std::cout << std::fixed << std::setprecision(2);

     std::cout << "p= " << perimeter << std::endl;

     std::cout << "s= " << area << std::endl;

     return 0;

}

29 tháng 8 2023

#include <iostream>
#include <iomanip>
using namespace std;

int main() {
    int r;
    const float Pi = 3.14;

    cout << "Nhap ban kinh hinh tron: ";
    cin >> r;

    float chu_vi = 2 * Pi * r;
    float dien_tich = Pi * r * r;

    cout << fixed << setprecision(2);
    cout << "p= " << chu_vi << endl;
    cout << "s= " << dien_tich << endl;

    return 0;
}

18 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

double xa,ya,xb,yb,xc,yc,ab,ac,bc;

int main()

{

cin>>xa>>ya>>xb>>yb>>xc>>yc;

ab=(sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)));

ac=(sqrt((xa-xc)*(xa-xc)+(ya-yc)*(ya-yc)));

bc=(sqrt((xb-xc)*(xb-xc)+(yb-yc)*(yb-yc)));

p=(ab+bc+ac)/2;

s=sqrt(p*(p-ab)*(p-ac)*(p-bc));

cout<<"Dien tich la:"<<fixed<<setprecision(2)<<s<<endl;

cout<<"Duong cao ung voi dinh A la:"<<fixed<<setprecision(2)<<2*s/bc<<endl;

cout<<"Duong cao ung voi dinh B la:"<<fixed<<setprecision(2)<<2*s/ac<<endl;

cout<<"Duong cao ung voi dinh C la:"<<fixed<<setprecision(2)<<2*s/ab<<endl;

return 0;

}

28 tháng 12 2020

b) 

uses crt;

var i,y:integer;

begin

clrscr;

y:=0;

for i:=1 to 100 do 

  y:=y+i;

writeln('y=',y);

readln;

end.

c) 

uses crt;

var y,i:integer;

begin

clrscr;

y:=0;

i:=1;

while y<=3200 do 

  begin

y:=y+i;

inc(i);

end;

writeln('y=',y);

readln;

end.

31 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

double xa,ya,xb,yb,xc,yc,ab,ac,bc,am;

int main()

{

cin>>xa>>ya>>xb>>yb>>xc>>yc;

ab=sqrt(pow(xa-xb,2)+pow(ya-yb,2));

ac=sqrt(pow(xa-xc,2)+pow(ya-yc,2));

bc=sqrt(pow(xb-xc,2)+pow(yb-yc,2));

cout<<"AB="<<fixed<<setprecision(2)<<ab<<endl;

cout<<"AC="<<fixed<<setprecision(2)<<ac<<endl;

cout<<"BC="<<fixed<<setprecision(2)<<bc<<endl;

am=((2*(ac*ac+bc*bc)-ab*ab)/4);

cout<<"AM="<<fixed<<setprecision(2)<<sqrt(am)<<endl;

return 0;

}

1 tháng 11 2021

cảm ơn ạ 

 

 

28 tháng 9 2021

Code c:

 

#include <stdio.h>

#include <conio.h>

#include <math.h>

#define PI 3.14159

int main() {

            int r;

            float chuvi, dientich;

            printf("Nhap ban kinh r:");

            scanf("%d", &r);

            chuvi = 2*PI*r;

            dientich = PI*r*r;

            printf("Chu vi hinh tron la: %f\n", chuvi);

            printf("Dien tich hinh tron la: %f", dientich);

            getch();

 

28 tháng 9 2021

BN THAM KHẢO:

Program S_Hinh_Tron;
Uses Crt;
Var r,S:real;
Begin
Clrscr;
Writeln(‘TINH DIEN TICH HINH TRON:’);
Write (‘Nhap ban kinh R=’);readln(r);
dt:=pi*r*r;
Writeln(‘Dien tich hinh tron la:’,dt:6:2);
Readln;
End.

14 tháng 3 2021

15 tháng 3 2021

Program HOC24;

const fi='INPUTC2.TXT';

var s,r: real;

f: text;

procedure ip;

begin 

assign(f,fi);

reset(f);

read(f,r);

s:=r*r*pi;

close(f);

end;

begin

ip;

write('S= ',s:1:2);

readln

end.