Sunday, 27 March 2016

Solution of URI 2029 :: Honey Reservoir


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>
#define PI 3.14

int main()
{
    double v, r, h, d, a;
    int tmp;
    while(scanf("%lf%lf", &v, &d)!=EOF)
    {
        r = d/2;
        a = PI*r*r;
        h = v/a;
        printf("ALTURA = %.2lf\n",h);
        printf("AREA = %.2lf\n",a);
    }
    return 0;
}

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.