|
|
back to boardDiscussion of Problem 1607. TaxiWa#13...Please help.Here is code: /////////////////////////////////////////////////////////// #include"iostream.h" #include"math.h" double a,d1,b,d2,m; int i,j; int main() { cin>>a>>d1>>b>>d2; if(a>=b){cout<<a<<endl;goto u;} if(a+d1>=b){cout<<b<<endl;goto u;} while(a<b) { a=a+d1; if(a>=b || a+d1>=b) { cout<<a<<endl; break; } b=b-d2; if(a>=b) { cout<<b<<endl; break; } } u: return 0; } ///////////////////////////////////////////////////////// |
|
|