机票打折

题目链接 难度等级 完成状态 完成分数 最后编辑时间 需要注意
求和 ★☆☆☆☆ 答案正确 100 2014/08/14 22:55:11

题意

整数a*实数b/10,结果四舍五入。

题解

入门题没什么好说的。直接调用了cmath的round函数。

代码

2235.cpp代码已折叠
展开折叠内容
显示/移除行号
  1. #include<cstdio>
  2. #include<cmath>
  3. int main(){
  4. double a,b;
  5. scanf("%lf %lf",&a,&b);
  6. printf("%d",(int)round(a*b/100)*10);
  7. return 0;
  8. }
  9.  

著作权声明[编辑]

关于[编辑]