小 (云璟月移动WikiOI/2235页面至CodeVS/2235:替换文字 - 「WikiOI」替换为「CodeVS」) |
小 (date) |
||
(未显示1个用户的1个中间版本) | |||
第1行: | 第1行: | ||
[[分类:浮点数处理]] | [[分类:浮点数处理]] | ||
==机票打折== | ==机票打折== | ||
− | {{信息题|求和|http://www.codevs. | + | {{信息题|求和|http://www.codevs.cn/problem/2235/|1|100|time=2014/08/14 22:55:11}} |
==题意== | ==题意== | ||
整数a*实数b/10,结果四舍五入。 | 整数a*实数b/10,结果四舍五入。 |
题目链接 | 难度等级 | 完成状态 | 完成分数 | 最后编辑时间 | 需要注意 |
---|---|---|---|---|---|
求和 | ★☆☆☆☆ | 答案正确 | 100 | 2014/08/14 22:55:11 | 无 |
整数a*实数b/10,结果四舍五入。
入门题没什么好说的。直接调用了cmath的round函数。
2235.cpp代码已折叠
展开折叠内容
|
---|
#include<cstdio> #include<cmath> int main(){ double a,b; scanf("%lf %lf",&a,&b); printf("%d",(int)round(a*b/100)*10); return 0; } |