-6
我找不出反餘弦部分來使它工作。或者我犯了更多的錯誤。在C++ visual studio中的cos定律
using namespace std;
int main()
{
double a,b,c,angle,acos;
cout << "Enter the value of a"<<endl;
cin >>a;
cout << " Enter the value of b "<<endl;
cin >> b;
cout << "Enter the value of c " <<endl;
cin >> c;
angle = acos*(-0.6481) * ((a*a+b*b-c*c)/2*a*b);
cout << "The angle of cos is " <<angle<< endl;
system ("pause");
}
不知道你在問什麼,但是當你第一次使用它時,'acos'是未初始化的。 – juanchopanza 2015-02-17 23:12:56
我正在尋找角度。 – 2015-02-17 23:15:04
如果'acos'初始化爲0,則角度將爲0。 – 2015-02-17 23:19:59