View Code of Problem 104

#include<stdio.h>
int main() {
	int n,v1,v2;
	double t,time;

	while(scanf("%d %d %d %lf",&n,&v1,&v2,&t)!=EOF) 
        {
                n*=1000;
		if(v1<v2)
		printf("N0\n");
		else {
		   time=(double) n/(v1-v2);
			if(time<=t)
				printf("%.2lf\n",time);
			else
				printf("N0\n");
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 104