View Code of Problem 104

#include<stdio.h>
#include<math.h>
int main(){
	int n,v1,v2;
	float t;
	
	
	while(scanf("%d%d%d%f",&n,&v1,&v2,&t)!=EOF){
		float t1;
		if(v2>v1){//这种情况永远不可能追上 
			printf("No\n"); 
		}else{
			t1=1000.00*n/(v1-v2);
			if(t1<t){
				printf("%.2f",t1);
			}else{
				printf("No\n");
			}
		}
		
	}
	
	
	
	return 0;
}

Double click to view unformatted code.


Back to problem 104