View Code of Problem 104

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

Double click to view unformatted code.


Back to problem 104