![]() |
#2
rjsp2016-09-08 10:18
|
include <iostream.h>
int abs (int x)
{
return x>0 ?x:-x;
}
double abs(double x)
{
return x>0 ?x:-x;
}
void main ()
{
cout <<"-10的绝对值是:"<<abs(-10) <<endl;
cout << "-123.45的绝对值是:"<< abs(-123.45) <<endl;
}