ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

Compilation 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
Posted by Hyppocrat (Adyghe SU) 2 Sep 2012 05:41
Just make vector of doubles. Everything will be OK.
Re: Compilation Error
Posted by Andrew Sboev [USU] 2 Sep 2012 09:41
Error because function sqrt() gets double or long double or float parameter.