题解 | #计算三角形的周长和面积#
计算三角形的周长和面积
https://www.nowcoder.com/practice/109a44d649a142d483314e8a57e2c710
#include <iostream>
#include <cmath>
#include <iomanip>
int main() {
double a, b, c;
std::cin >> a >> b >> c;
double circumference = a + b + c;
double s = circumference / 2;
double area = std::sqrt(s * (s - a) * (s - b) * (s - c));
std::cout << std::fixed << std::setprecision(2) << "circumference=" << circumference << " area=" << area << std::endl;
return 0;
}
传音控股晋升空间 50人发布
