UVA 10387 (暑假-几何 -C - Billiard)

#include <cstdio>
#include <cmath>
using namespace std;

int main() {
	double a, b, s, m, n;
	while (scanf("%lf%lf%lf%lf%lf", &a, &b, &s, &m, &n) && (a || b || s || m || n)) {
		double side = sqrt((a*m)*(a*m) + (b*n)*(b*n)); 
		double velocity = side / s;
		double angle = acos( a*m / side ) * 180/3.1415926;
		printf("%.2lf %.2lf\n", angle, velocity);
	}
	return 0;
}

你可能感兴趣的:(UVA 10387 (暑假-几何 -C - Billiard))