View Code of Problem 104

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
    double n,v1,v2,t;
    while(scanf("%lf%lf%lf%lf",&n,&v1,&v2,&t)!=EOF)
    {

    if((v1-v2)*t-n*1000<0)
    {
        printf("NO\n");
    }
    else
    {
         t=(n*1000)/(v1-v2);
            printf("%0.2lf\n",t);
    }
    }

    return 0;
}

Double click to view unformatted code.


Back to problem 104