[UVA]11524 - InCircle

基础题。

atan() 返回的是 弧度,而不是角度

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
const double eps = 1e-10;
#define _PI acos(-1.0)
int main(){
    double a,b;
    int Case = 1;
    while(scanf("%lf : %lf",&a,&b) != EOF){
        double rad = atan(b / a);
        double x = 1.0 * 400 / (2 * rad / cos(rad) + 2);
        double y = b * x / a;
        printf("Case %d: %.10f %.10f\n",Case++,x,y);
    }
    return 0;
}

你可能感兴趣的:([UVA]11524 - InCircle)