题目链接:https://vjudge.net/problem/UVA-11646
题意:按比例计算出符合圆内接矩形的长和宽的值
水题,在草稿纸上通过代数演算一下就可以化简成最终形式,化简过程很简单,这里就不贴出来了
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
#define pi acos(-1.0)
#define eps 1e-10
#define pf printf
#define sf scanf
#define lson rt<<1,l,m
#define rson rt<<1|1,m+1,r
#define e tree[rt]
#define _s second
#define _f first
#define all(x) (x).begin,(x).end
#define mem(i,a) memset(i,a,sizeof i)
#define for0(i,a) for(int (i)=0;(i)<(a);(i)++)
#define for1(i,a) for(int (i)=1;(i)<=(a);(i)++)
#define mi ((l+r)>>1)
#define sqr(x) ((x)*(x))
const int inf=0x3f3f3f3f;
int m,n;
char g;
int main()
{
int p=0;
while(cin>>m>>g>>n)
{
double a=sqrt(m*m+n*n);
double b=n/a;
double c=a/m;
double d=asin(b);//asin的返回值就是nPI,不需要除以180转换
double f=d*c+1;
double x=200/f;
double y=n*x/m;
pf("Case %d: %.10f %.10f\n",++p,x,y);
}
return 0;
}