Sunday, April 24, 2016

UVA 11909 - Soya Milk : Solution

Unknown
#include <stdio.h>
#include <math.h>
int main()
{
    int l,w,h,t;
    double pi,d,v;
    pi=acos(-1);
    while(scanf("%d %d %d %d",&l,&w,&h,&t)==4)
    {
        d=l*tan(t*pi/180.0);
        if(d > h) v=0.5*h*h*l*w/d;
        else v=l*w*((h)-(d*0.5));
        printf("%.3lf mL\n", v);
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,