#include <iostream>
void increment_display(int userChoice)
{
std::cout << "increment_display:" << userChoice << std::endl;
for (int i = 0; i < userChoice; ++i)
{
std::cout << "Loop " << i + 1 << ": " << userChoice - i << std::endl;
}
}
void decrement_display(int userChoice)
{
std::cout << "decrement_display:" << userChoice << std::endl;
for (int i = userChoice; i != 0; --i)
{
std::cout << "Loop " << userChoice - i + 1 << ": " << i << std::endl;
}
}
int main() {
increment_display(5);
decrement_display(5);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKCnZvaWQgaW5jcmVtZW50X2Rpc3BsYXkoaW50IHVzZXJDaG9pY2UpCnsKCXN0ZDo6Y291dCA8PCAiaW5jcmVtZW50X2Rpc3BsYXk6IiA8PCB1c2VyQ2hvaWNlIDw8IHN0ZDo6ZW5kbDsKCWZvciAoaW50IGkgPSAwOyBpIDwgdXNlckNob2ljZTsgKytpKQoJewoJICAgIHN0ZDo6Y291dCA8PCAiTG9vcCAiIDw8IGkgKyAxIDw8ICI6ICIgPDwgdXNlckNob2ljZSAtIGkgPDwgc3RkOjplbmRsOwoJfQp9Cgp2b2lkIGRlY3JlbWVudF9kaXNwbGF5KGludCB1c2VyQ2hvaWNlKQp7CglzdGQ6OmNvdXQgPDwgImRlY3JlbWVudF9kaXNwbGF5OiIgPDwgdXNlckNob2ljZSA8PCBzdGQ6OmVuZGw7Cglmb3IgKGludCBpID0gdXNlckNob2ljZTsgaSAhPSAwOyAtLWkpCgl7CgkgICAgc3RkOjpjb3V0IDw8ICJMb29wICIgPDwgdXNlckNob2ljZSAtIGkgKyAxIDw8ICI6ICIgPDwgaSA8PCBzdGQ6OmVuZGw7Cgl9Cn0KCgppbnQgbWFpbigpIHsKICAgIGluY3JlbWVudF9kaXNwbGF5KDUpOwogICAgZGVjcmVtZW50X2Rpc3BsYXkoNSk7Cn0K