|
|
back to boardCompilation Error Posted by Csarg 2 Sep 2012 02:51 It works in my computer 0k... #include<iostream> #include<string.h> #include<cstdio> #include<vector> #include<cmath> using namespace std; int main(){ unsigned long long aux; vector<unsigned long long>v1; while(cin >> aux)v1.push_back(aux); int i=v1.size()-1; while(i>=0){ printf("%.4f\n",sqrt(v1[i])); i--; } } cb37c1a6-2f8c-4b8d-9b35-bb945448c8b1 cb37c1a6-2f8c-4b8d-9b35-bb945448c8b1(14) : error C2668: 'sqrt' : ambiguous call to overloaded function S:\checker\compile\vc10\include\math.h(589): could be 'long double sqrt(long double)' S:\checker\compile\vc10\include\math.h(541): or 'float sqrt(float)' S:\checker\compile\vc10\include\math.h(127): or 'double sqrt(double)' while trying to match the argument list '(unsigned __int64)' Re: Compilation Error Just make vector of doubles. Everything will be OK. Re: Compilation Error Error because function sqrt() gets double or long double or float parameter. |
|
|