c++ 的绝对值函数

添加头文件

#include <cmath>

对于整数

abs();

对于浮点数

fabs();

转载于:https://www.cnblogs.com/houchen/p/9145456.html