#include <iostream>
using namespace std;
int dodaj_premie(int a, int b) {
cout << "-----------------" << endl;
cout << "W funkcji: adres zmiennej a=" << &a
<< " a zmiennej b=" << &b << endl;
a = a + 100;
b = b + 100;
cout << "W funkcji: a=" << a << ", b=" << b << endl;
cout << "-----------------" << endl;
return 0;
}
int main() {
int a = 10, b = 20;
cout << "W main(): adres zmiennej a=" << &a
<< " a zmiennej b=" << &b << endl;
cout << "Przed: a=" << a << ", b=" << b << endl;
dodaj_premie(a, b);
cout << "W main(): adres zmiennej a=" << &a
<< " a zmiennej b=" << &b << endl;
cout << "Po: a=" << a << ", b=" << b << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IGRvZGFqX3ByZW1pZShpbnQgYSwgaW50IGIpIHsKCWNvdXQgPDwgIi0tLS0tLS0tLS0tLS0tLS0tIiA8PCBlbmRsOwoJY291dCA8PCAiVyBmdW5rY2ppOiAgYWRyZXMgem1pZW5uZWogYT0iIDw8ICZhIAoJICAgICA8PCAiIGEgem1pZW5uZWogYj0iIDw8ICZiIDw8IGVuZGw7CgkKCWEgPSBhICsgMTAwOwoJYiA9IGIgKyAxMDA7Cgljb3V0IDw8ICJXIGZ1bmtjamk6ICBhPSIgPDwgYSA8PCAiLCBiPSIgPDwgYiA8PCBlbmRsOwoJY291dCA8PCAiLS0tLS0tLS0tLS0tLS0tLS0iIDw8IGVuZGw7CglyZXR1cm4gMDsKfQoKaW50IG1haW4oKSB7CglpbnQgYSA9IDEwLCBiID0gMjA7Cgljb3V0IDw8ICJXIG1haW4oKTogICBhZHJlcyB6bWllbm5laiBhPSIgPDwgJmEgCgkgICAgIDw8ICIgYSB6bWllbm5laiBiPSIgPDwgJmIgPDwgZW5kbDsKCWNvdXQgPDwgIlByemVkOiAgICAgIGE9IiA8PCBhIDw8ICIsIGI9IiA8PCBiIDw8IGVuZGw7Cglkb2Rhal9wcmVtaWUoYSwgYik7Cgljb3V0IDw8ICJXIG1haW4oKTogICBhZHJlcyB6bWllbm5laiBhPSIgPDwgJmEgCgkgICAgIDw8ICIgYSB6bWllbm5laiBiPSIgPDwgJmIgPDwgZW5kbDsKCWNvdXQgPDwgIlBvOiAgICAgICAgIGE9IiA8PCBhIDw8ICIsIGI9IiA8PCBiIDw8IGVuZGw7CglyZXR1cm4gMDsKfQ==