|
|
back to boardDiscussion of Problem 1607. TaxiWa#14...Please help.Here is code: Posted by Search 7 Mar 2008 20:22 #include<iostream.h> #include<math.h> int main() { int a1,b1,a2,b2; cin>>a1>>b1>>a2>>b2; if(a2<=a1) cout<<a1; else if(abs(a1-a2)<b1) cout<<a2; else{ while(a1<a2) { a1+=b1; a2-=b2; } if(a1>a2) cout<<a1; else cout<<a2; } return 0; } Where I'm wrong?Please help!Thank in advance!!! * Posted by Брэнд 8 Mar 2008 00:39 For test "1 4 10 2" right answer is 8. Re: * >> 1 << 10 >> 5 << 8 >> 9, but 8 |
|
|