View Code of Problem 104

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
    double n,v1,v2,t;
    while (cin>>n>>v1>>v2>>t)
    {
        /* code */
        if( v1 <= v2 )cout<<"NO"<<endl;
        else
        {            
            if( n*1000.0/(v1-v2) < t)
            cout<<fixed<<setprecision(2)<<(n*1000.0/(v1-v2))<<endl;
            else cout<<"NO"<<endl;           
        }        
    }    
}

Double click to view unformatted code.


Back to problem 104