poj 3077 Rounders
2012-06-15 20:10
295 查看
#include <iostream> #include <string> #include <cmath> using namespace std; int main() { int tc, len, i, ans, tmp; string num; cin >> tc; while (tc--){ cin >> num; len = num.length(); if (len == 1) cout << num << endl; else{ for (i = len - 1; i >= 0; i--){ tmp = num[i]-48; if (tmp >= 5) num[i-1]++; } len = num.length(); ans = (num[0]-48) * pow(10, float(len-1)); cout << ans << endl; } } system("pause"); }
相关文章推荐
- poj 3077Rounders(模拟)
- poj 3077Rounders(模拟)
- poj 3077 Rounders 【简单字符串处理】
- poj 3077 Rounders
- POJ 3077-Rounders(水题乱搞)
- poj 3077 Rounders
- POJ 3077 Rounders(我的水题之路——高精度四舍五入)
- POJ 3077 Rounders
- poj 3077 Rounders
- POJ 3077 : Rounders
- POJ 3077 : Rounders
- POJ 3077 Rounders(高精度)
- poj 3077 Rounders(水题)
- POJ 3077 Rounders G++
- POJ 3077-Rounders
- poj 3077 Rounders/bnuoj 3196 Rounders 解题报告
- POJ 3077-Rounders(水题乱搞)
- poj 3077 递归
- POJ-3077
- poj 3615 :Cow Hurdles (floyd)----很好