Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int m1, c1;
- int m2, c2;
- int m3, c3;
- int bucket = 1;
- cin >> c1 >> m1;
- // read in row 2: TODO
- // read in row 3: TODO
- // TODO: for loop to repeat this 100 times
- // (repeat everything 33 times, then do pour bucket 1 into 2 an extra time)
- // pour bucket 1 into bucket 2
- m2 = m1 + m2;
- m1 = 0;
- if (m2 > c2) {
- // uh oh we overflowed!
- int move_back = m2 - c2;
- m1 = m1 + move_back;
- m2 = m2 - move_back;
- }
- // pour bucket 2 into bucket 3: TODO
- // pour bucket 3 into bucket 1: TODO
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement