添加头函数

#include<cmath>

对于整数:

int abs(int i)

对于浮点数:

double fabs(double i)
float fabs(float i)

C++11标准

double abs (double x);

float abs (float x);

long double abs (long double x);

double abs (T x);

版权声明:本文为blink_cao原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/blink_cao/article/details/105571800