View Code of Problem 104

#include<iostream>
using namespace std;
int main(){
	int n,v1,v2,t;
	while(cin>>n>>v1>>v2>>t){
		float s;
	//	if(v1-v2>0){
			s=(float)n*1000/(v1-v2);
			if(s>t||s<0){
				cout<<"NO"<<'\n';
			}
			else printf("%.2f\n",s);
			
			
	//	}
	//	else cout<<"NO"<<'\n';
	}
}

Double click to view unformatted code.


Back to problem 104