Following is compilation error
In function 'int main()':
error: call of overloaded 'abs(long long int&)' is ambiguous
It works for me with MinGW GCC 4.8.1 32-bit.
Maybe try
#include <cstdlib>
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <iostream>
// #include <cmath>
#include <cstdlib>
using namespace std;
int main()
{
long long int x;
cin >> x;
cout << abs(x);
return 0;
}
|
http://www.cplusplus.com/reference/cstdlib/abs/
Last edited on