View Code of Problem 104

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

Double click to view unformatted code.


Back to problem 104