火车过桥-题解

描述

滨江大桥的长度为5500米,一辆火车的长度是500米,假设火车的速度是a米每秒,请问火车从驶入大桥,到车尾驶出大桥需要多长时间呢?

时间 = 路程/速度

输入描述

一个整数,表示火车的速度

输出描述

一个整数,表示需要的时间(结果取整)

代码

1
2
3
4
5
6
7
8
9
#include <bits/stdc++.h>
using namespace std;

int main(){
int a;
cin >> a;
cout << 6000 /a;
return 0;
}

火车过桥-题解
https://chenxi-8gs.pages.dev/2025/06/08/火车过桥-题解/
作者
chenxi
发布于
2025年6月8日
许可协议