为什么用a,b,c不能用int
查看原帖
为什么用a,b,c不能用int
1469998
wayne_15532楼主2024/10/1 13:08
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    double d = 1.0 / 2 * (a + b + c);
    cout << fixed << setprecision(1)
        << sqrt(d * (d - a) * (d - b) * (d - c));
    return 0;
}
2024/10/1 13:08
加载中...