View Code of Problem 104

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

Double click to view unformatted code.


Back to problem 104