Thứ Sáu, 13 tháng 5, 2022

TG C++

#include<bits/stdc++.h>
using namespace std;

int a,b,c;
float s,p;
int main()
{
    freopen("tg.inp","r",stdin);
    freopen("tg.out","w",stdout);
    cin>>a>>b>>c;
    p=a+b+c;
    s=sqrt((p/2)*((p/2)-a)*((p/2)-b)*((p/2)-c));
    cout<<"Chu vi la "<<p<<endl;
    cout<<"Dien tich la "<<setprecision(2)<<fixed<<s;
}

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.