求实数的绝对值。
Input Specification:
输入数据有多组,每组占一行,每行包含一个实数。
Output Specification:
对于每组输入数据,输出它的绝对值,要求每组数据输出一行,结果保留两位小数。
Sample Input:
123
-234.00
Sample Output:
123.00
234.00
注意:
不要忘了最后的回车\n
代码:
/**
* 02.27 22:29
*
**/
#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main() {
double a;
while(scanf("%lf", &a) != EOF){
printf("%.2lf\n", abs(a));
}
return 0;
}