这里怎么了?错误为“[error]在数值常量之前应为‘,’或‘;’”
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a = 8;
double b = 2;
double c = sqrt 8.0,2.0);
cout << "a = 8\nb = 2\nc = square from 8 = " << c << "\n";
}
sqrt
只接受单个参数,例如double c=sqrt(a+b);