#include
using namespace std;
int abs_1(int);
double abs_1(double);
int main()
{
int a;
double b;
cout<<"Please enter the number of int:";
cin>>a;
cout<<"Pleade enter the number of double:";
cin>>b;
cout<
int abs_1(int x)
{
if(x>=0) return x;
else return (-1)*x;
}
double abs_1(double x)
{
if(x>=0) return x;
else return (-1)*x;
}
望及时采纳,楼下的不要复制哦
#include
using namespace std;
float ab_s(float x)
{
return x<0?-x:x;
}
int main()
{
float x;
float n;
cout<<"请输入一个实数:"<
n=ab_s(x);
cout<<"x的绝对值是"<
}