21 lines
229 B
C
21 lines
229 B
C
|
#include <base.h>
|
||
|
|
||
|
int max(const int x, const int y)
|
||
|
{
|
||
|
return (x<y?y:x);
|
||
|
}
|
||
|
|
||
|
int min(const int x, const int y)
|
||
|
{
|
||
|
return (x>y?y:x);
|
||
|
}
|
||
|
|
||
|
int sgn(const int x)
|
||
|
{
|
||
|
if (x>0)
|
||
|
return 1;
|
||
|
else if (x<0)
|
||
|
return -1;
|
||
|
else
|
||
|
return 0;
|
||
|
}
|