写一个++程序,提示拥护输入三角形的三边长a b c 然后计算三角形的面积area
来源:百度知道 编辑:UC知道 时间:2024/06/14 02:40:19
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, char **argv)
{
double a, b, c, s, r;
cout<<"input 3 lines:"<<endl;
cin>>a>>b>>c;
s=(a+b+c)/2;
r = sqrt(s*(s-a)*(s-b)*(s-c));
cout<<"result is: "<<r<<endl;
system("pause");
return 0;
}
这个样子的问题也问
真无奈
就是考试的时候玩过C++
现在全忘了