#include <stdio.h>
#include <math.h>
double u, v, t, s, a;
int main()
{
int n, caseNum = 1;
while( scanf("%d", &n) == 1 && n)
{
printf("Case %d: ", caseNum ++);
switch (n)
{
case 1:
scanf("%lf %lf %lf", &u, &v, &t);
a = (v - u) / t;
s = (v * v - u * u) / (2 * a);
printf("%.3lf %.3lf\n", s, a);
break;
case 2:
scanf("%lf %lf %lf", &u, &v, &a);
t = (v - u) / a;
s = (v * v - u * u) / (2 * a);
printf("%.3lf %.3lf\n", s, t);
break;
case 3:
scanf("%lf %lf %lf", &u, &a, &s);
v = sqrt((u * u + 2 * a * s));
t = (v - u) / a;
printf("%.3lf %.3lf\n", v, t);
break;
case 4:
scanf("%lf %lf %lf", &v, &a, &s);
u = sqrt((v * v - 2 * a * s));
t = (v - u) / a;
printf("%.3lf %.3lf\n", u, t);
break;
}
}
return 0;
}
回目錄
回首頁
沒有留言 :
張貼留言