出租车费
来源:互联网 发布:中交天津工贸公司知乎 编辑:程序博客网 时间:2024/06/08 03:00
#include <iostream>#include <iomanip>#include <cmath>using namespace std;int main(){ long long int n; while(cin>>n) { if(n==0) return 0; double sum=0; double sum1=0; if(n<=4) sum=10; else if(n>4&&n<=8) { sum=10+2*(n-4); } else if(n>8) { if(n%8==0) sum=n/8*18; else { int k=n/8; if(n-k*8<=4) { sum=k*18+(n-8*k)*2.4; } else { sum=k*18+10+(n-8*k-4)*2; } } } if(int(sum)==sum) cout<<int(sum)<<endl; else cout<<fixed<<setprecision(1)<<sum<<endl; } return 0;}
- 出租车费
- 出租车费
- 出租车费
- 出租车费
- 出租车费
- 出租车费
- SDJZUOJ 1128 出租车费
- SDJZU 出租车费
- SDJZU-出租车费
- SDJZU 出租车费
- SDJZ 出租车费
- 1128: 出租车费
- codeup 1128 出租车费
- 贪心问题 B: 出租车费
- 贪心入门——出租车费
- 湖北民族学院oj 1691(贪心) 之 出租车费
- if语句的运用:用C语言解决奖金发放和出租车费问题。
- 学车费用
- android开发 activity 的四种启动模式!
- 取ds的行数,FOR数组遍历,没有用foreach
- Basic Git commands
- HTML5+CSS3+JQuery1.9 输入框切换和Div失焦模拟
- 《YV12和I420的区别》评注
- 出租车费
- ORACLE ORDER BY 排序规则
- LPCTSTR和CString的关系
- C# 从exce里读取时间
- oracle update commit 后恢复
- 编程的未来
- 步步学GDB-《2》
- Struts2 Action
- 常用正则表达式