<swustoj>?id=1159 吃披萨

链接http://acm.swust.edu.cn/problem/1159/

海伦公式http://baike.baidu.com/view/1279.htm

#include <stdio.h>
#include <math.h>
#define PI 3.14
int main()
{
    double r,a,b,c,p;
    double s_circle,s_triangle;
    while(scanf("%lf %lf %lf %lf",&r,&a,&b,&c)!=EOF)
    {
        s_circle=PI*r*r;
        p=(a+b+c)/2;
        s_triangle=sqrt(p*(p-a)*(p-b)*(p-c));
        if(s_circle>s_triangle)
        {
            printf("A\n");
        }
        else
        {
            printf("B\n");
        }
    }
    return 0;
}

 

posted @ 2016-07-31 22:14  艹kiss灬不离  阅读(270)  评论(0编辑  收藏  举报