Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120504 李茗宇 08打车费用 C++ Accepted 1 MS 272 KB 439 2025-05-28 18:35:53

Tests(10/10):


Code:

#include <iostream> using namespace std; int main() { int distance; cin >> distance; double fare = 6.0; // 起步价 if (distance > 2 && distance <= 10) { fare += (distance - 2) * 1.8; } else if (distance > 10) { fare += 8 * 1.8; // 2-10km部分 fare += (distance - 10) * 1.8 * 1.5; // 超过10km部分加价50% } cout << fare << endl; return 0; }