UVa 10773

题目:渡河问题。给你河水宽度,水流速度,求垂直渡河与最快渡河的时间差。

分析:物理题,数学题。

               最快渡河情况,传垂直运动,垂直渡河,船的水平分速度和水流速度抵消。

说明:注意水流速度不能为0。

#include <cstdio>
#include <cmath>

int main()
{
	int T;
	scanf("%d",&T);
	for (int t = 1 ; t <= T ; ++ t) {
		double d,v,u;
		scanf("%lf%lf%lf",&d,&v,&u);

		printf("Case %d: ",t);
		if (u > v && v)
        	printf("%.3lf
",d/sqrt(u*u-v*v)-d/u);
		else printf("can't determine
");
	}
	return 0;
}


原文地址:https://www.cnblogs.com/tlnshuju/p/6953807.html