大体题意:

如图:

UVA 11646 Athletics Track (简单数学题)_几何

告诉你长和宽的比 为a : b 求出  长度和宽度的实际值!

思路:

令长为ax, 宽为bx!

那么

UVA 11646 Athletics Track (简单数学题)_数学_02


UVA 11646 Athletics Track (简单数学题)_#include_03

====》

UVA 11646 Athletics Track (简单数学题)_数学_04

由于勾股定理:

UVA 11646 Athletics Track (简单数学题)_#include_05

带入得:

UVA 11646 Athletics Track (简单数学题)_C++_06

答案就是ax : bx了!

代码:

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;
int main(){
    double a,b;
    int kase=0;
    while(scanf("%lf : %lf",&a,&b) == 2){
        double x = 200.0/(a+atan(b/a)*sqrt(a*a+b*b));
        printf("Case %d: %.15lf %.15lf\n",++kase,a*x,b*x);
    }
    return 0;
}