View Code of Problem 104

#include<stdio.h>
int main()
{
	int n,v1,v2;
	double t;
	while(scanf("%d %d %d %lf",&n,&v1,&v2,&t)!=EOF)
	{
		n*=1000;
		if(v2>v1)	printf("NO\n");
		else
		{
			double t1=(double)n/(v1-v2);
			if(t1<=t)
				printf("%.2lf\n",t1);
			else printf("NO\n");
		}	
	}	
} 

Double click to view unformatted code.


Back to problem 104