题目来源:码蹄集
https://matiji.net/exam/brushquestion/37/778/B3FCFEC101BD05189BB74D522E019504
时间限制:1000ms
内存限制:65535kb
题目描述:输入数字a并计算a的绝对值。不考虑不合理的输入或是溢出等特殊情况。
输入格式:输入实型数字a
输出格式:输出a的绝对值,输出为实型
输入样例:-5.1
输出样例:5.100000
参考程序:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double a;
scanf("%lf",&a);
printf("%lf\n",fabs(a));
return 0;
}