Code: Select all
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int a = -1;
int b = abs(a);
cout << b << endl;
return 0;
}
Moderator: Board moderators
Code: Select all
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int a = -1;
int b = abs(a);
cout << b << endl;
return 0;
}
should've beenImLazy wrote:Code: Select all
#include <cmath>
Code: Select all
#include <cstdlib>
And in case you only have windoze and no man pages, google for "man abs"sumankar wrote:man for abs.
"man" is short for manual, this is the standard *NIX way of accessing simple text-based documentation to almost everything. The most common are man pages for programs, but there are also man pages for C functions, system calls, and many other things.ImLazy wrote:I don't quite understande what is man page.
At least now I know I should include <cstdlib> instead of <cmath>. Thank you.