您的位置:首页 > 其它

HDU 2548.两军交锋

2017-12-26 16:32 169 查看
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2548

AC代码(C++):

#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <math.h>

#define INF 0x3f3f3f3f
#define eps 1e-8

using namespace std;

int main() {
int t;
cin >> t;
while (t--) {
double u, v, w, l;
cin >> u >> v >> w >> l;
double ans = (l / (u + v))*w;
printf("%.3lf\n", ans);
}

//system("pause");
}

总结: 水题. 总距离等于记者速度*交锋时间.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: