Sunday, 28 December 2014

UVA 10195 - The Knights Of The Round Table(c file)

Problem Type : Geometry


#include<stdio.h>
#include<math.h>
int main()
{
    double a,b,c,s,l,r,m;
    while(scanf("%lf%lf%lf",&a,&b,&c)==3)
    {
        s=(a+b+c)/2;
        if(s==0)
        {
            printf("The radius of the round table is: 0.000\n");
        }

        else if(s>0)
        {
            l=(s*(s-a)*(s-b)*(s-c));
            r=sqrt(l)/s;
            printf("The radius of the round table is: %.3lf\n",r);
        }

    }
    return 0;
}

No comments:

Post a Comment

ট্রিগার এর মাধ্যমে ডাটা ইনসার্ট - insert data using Database Trigger (Mysql)

সর্বপ্রথম আমরা প্রবলেমটা বুঝিঃ আমি একটা টেবিলের একটা কলামের ভ্যালুর উপর ডিপেন্ড করে আরেকটা কলামে ডাটা insert করব । এই কাজটা ট্রি...