1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <iostream> void change_one_print_other( int& a, const int& b ) { a = 0; std::cout << b << "\n"; } int main(void) { int x = 5, y = 5; change_one_print_other(x, x); change_one_print_other(y, static_cast<int>(y)); } |
ICAgICNpbmNsdWRlIDxpb3N0cmVhbT4KCiAgICB2b2lkIGNoYW5nZV9vbmVfcHJpbnRfb3RoZXIoIGludCYgYSwgY29uc3QgaW50JiBiICkKICAgIHsKICAgICAgICBhID0gMDsKICAgICAgICBzdGQ6OmNvdXQgPDwgYiA8PCAiXG4iOwogICAgfQoKICAgIGludCBtYWluKHZvaWQpCiAgICB7CiAgICAgICAgaW50IHggPSA1LCB5ID0gNTsKCiAgICAgICAgY2hhbmdlX29uZV9wcmludF9vdGhlcih4LCB4KTsKICAgICAgICBjaGFuZ2Vfb25lX3ByaW50X290aGVyKHksIHN0YXRpY19jYXN0PGludD4oeSkpOwogICAgfQ==
-
upload with new input
-
result: Success time: 0s memory: 2724 kB returned value: 0
0 5


