codevs 1206 保留两位小数
2013-08-13 18:02
375 查看
http://codevs.cn/problem/1206/
空间限制: 128000 KB
题目等级 : 青铜 Bronze
题解
查看运行结果
题目描述 Description
保留两位小数输出一个浮点数。
输入描述 Input Description
一个浮点数。double范围内
输出描述 Output Description
保留两位小数输出
样例输入 Sample Input
11
样例输出 Sample Output
11.00
数据范围及提示 Data Size & Hint
View Code
1206 保留两位小数
时间限制: 1 s空间限制: 128000 KB
题目等级 : 青铜 Bronze
题解
查看运行结果
题目描述 Description
保留两位小数输出一个浮点数。
输入描述 Input Description
一个浮点数。double范围内
输出描述 Output Description
保留两位小数输出
样例输入 Sample Input
11
样例输出 Sample Output
11.00
数据范围及提示 Data Size & Hint
C++用 printf("%.2lf",a);
Pascal用 writeln(a:0:2);
C++和Pascal用户都请使用double类型,不要使用float,real,extended类型。 分析: 水题。 AC代码:
/* 作者:1348066599@qq.com 题目:p1206 保留两位小数 */ #include <stdio.h> #include <algorithm> #include <iostream> #include <string.h> #include <string> #include <math.h> #include <stdlib.h> #include <queue> #include <stack> #include <set> #include <map> #include <list> #include <iomanip> #include <vector> #pragma comment(linker, "/STACK:1024000000,1024000000") #pragma warning(disable:4786) using namespace std; const int INF = 0x3f3f3f3f; const int MAX = 10000 + 10; const double eps = 1e-8; const double PI = acos(-1.0); int main() { double a; while(~scanf("%lf", &a)) { printf("%.2lf\n",a); } return 0; }
View Code
相关文章推荐
- codevs 1206 保留两位小数 题目等级:青铜 printf("%.2lf
- 1206 保留两位小数
- WikiOI 1206 保留两位小数
- wikioi 1206 保留两位小数 【考查浮点数输入输出】
- code[vs] 1206 保留两位小数
- CODEVS--1206 保留两位小数
- 1206 保留两位小数
- Wikioi 天梯 保留两位小数(1206)
- WIKIOI--1206保留两位小数
- DecimalFormat 实现保留两位小数
- js保留两位小数和两个数比较大小的方法
- mysql格式化小数保留小数点后两位(小数点格式化)
- JavaScript四舍五入并保留两位小数
- 将数字四舍五入保留两位小数
- double :数据类型保留两位小数,不足补0,满10进1
- 数字千分位处理,number.js,js保留两位,整数强制保留两位小数
- Jackson转换实体 double 保留两位小数
- java中保留两位小数
- javascript实现保留两位小数的多种方法
- java保留两位小数4种方法