#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double a, b, c, P, S;
double x;
x = P*(P - a)(P - b)(P - c);
cout << "Enter first length" << "\n";
cin >> a;
cout << "Enter second length" << "\n";
cin >> b;
cout << "Enter third length" << "\n";
cin >> c;
P = a + b + c / 2;
S = sqrt(x);
cout << "The S is" << S << "\n";
return 0;
}
哪里需要修改???
#include <math.h>
using namespace std;
int main()
{
double a, b, c, P, S;
double x;
x = P*(P - a)(P - b)(P - c);
cout << "Enter first length" << "\n";
cin >> a;
cout << "Enter second length" << "\n";
cin >> b;
cout << "Enter third length" << "\n";
cin >> c;
P = a + b + c / 2;
S = sqrt(x);
cout << "The S is" << S << "\n";
return 0;
}
哪里需要修改???