We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1da1c1 commit b9a4ee1Copy full SHA for b9a4ee1
_posts/2014-09-18-absulote.md
@@ -0,0 +1,35 @@
1
+---
2
+layout: post
3
+title: 2003.求绝对值
4
+date: 2014-09-18 14:04
5
+categories: 杭电HDU
6
+tags: [杭电HDU]
7
8
+## Problem
9
+>**Problem Description**
10
+求实数的绝对值。
11
+**Input**
12
+输入数据有多组,每组占一行,每行包含一个实数。
13
+**Output**
14
+对于每组输入数据,输出它的绝对值,要求每组数据输出一行,结果保留两位小数。
15
+**Sample Input**
16
+123
17
+-234.00
18
+**Sample Output**
19
+123.00
20
+234.00
21
+
22
+## Solution
23
+```cpp
24
+#include<stdio.h>
25
+#include<math.h>
26
+int main()
27
+{
28
+ double num;
29
+ while(scanf("%lf",&num)!=EOF){
30
+ num=fabs(num);
31
+ printf("%.2lf\n",num);
32
+ }
33
+return 0;
34
+}
35
+```
0 commit comments