Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <math.h>
- #include <algorithm>
- #include <vector>
- using namespace std;
- int main()
- {
- int a, b, c, d;
- cin >> a >> b >> c >> d;
- while (c !=-9000)
- {
- if (c <= a)
- {
- cout << a;
- break;
- }
- a += b;
- if (c <= a)
- {
- cout << c;
- break;
- }
- c -= d;
- if (c <= a)
- {
- cout << a;
- break;
- }
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment