/usr/include/i386-linux-gnu/bits/mathcalls.h:311:1: error: ambiguates old declaration ‘double round(double)’ g.cpp: In function ‘int round(double)’: g.cpp:14:24: error: new declaration ‘int round(double)’ /usr/include/i386-linux-gnu/bits/mathcalls.h:311:1: error: ambiguates old declaration ‘double round(double)’
#include <iostream>
#include <cmath>
using namespace std;
int round(double number);
int main()
{
double number = 5.9;
round(number);
return 0;
}
int round(double number)
{
return static_cast<int>(floor(number + 0.5));
}
为什么我的编译器显示错误