Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int remainder, cola;
- while(cin >> remainder){
- for(cola = remainder, remainder++; remainder >= 3; remainder -= (remainder / 3) * 2)
- cola += remainder / 3;
- cout << cola << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement