Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
5411 | 翟** | 08打车费用 | C++ | Accepted | 0 MS | 268 KB | 768 | 2024-11-16 09:24:48 |
#include <typeinfo> //变量类型头文件,还是有问题;无法判断int #include <iostream> //包含输入输出流头文件iostream using namespace std; //指明程序 使用命名空间std(标准) int main() { int path_l,time_sj; //path_l,time_sj代表路程,停车时间 float cost=0; //cost代表费用 cin>>path_l; //输入路程 if (path_l>10) //当路程大于10公里时 cost=6+(10-2)*1.8+(path_l-10)*1.8*1.5; else if (path_l>2) cost=6+(path_l-2)*1.8; else cost=6; cin>>time_sj; //输入停车时间 cost+=(time_sj/3)*1; //计算停车费用 cout<<cost<<endl; return 0; }