|
|
back to boardDiscussion of Problem 1607. TaxiI ask you for some attantion with WA 4 in C++ programm Here is my code: #include <iostream> using namespace std; void main() { int a,da,b,db; cin >> a >> da >> b >> db; while(a<b) { if(a>=b) { cout << a; return; } a+=da; if(a>=b) { cout << a; return; } b-=db; } cout << a; } What could be wrong in my code that it dont work in test #4? Thanks a lot. |
|
|