Friday 18 March 2016

Solution of URI 1116 :: Dividing X by Y


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>
int main()
{
    int a,b,c,d;
    double e;
    scanf("%d", &a);
    for(b=1; b<=a; b++)
    {
        scanf("%d%d", &c, &d);
        if(d==0)
            printf("divisao impossivel\n");
        else
        {
            e=c/(d*1.00);
            printf("%.1lf\n", e);
        }
    }
    return 0;
}

1 comment:

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