Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // Funkcja nie moze zwracac dwoch zmiennych jak jest w poleceniu,
- // wiec zrobilem to posylajac voidowi oryginalne zmienne
- void ZAMIANA(float &a, float &b)
- {
- float bufor;
- bufor = a;
- a = b;
- b = bufor;
- }
- int main()
- {
- float a = 5;
- float b = 8;
- ZAMIANA(a, b);
- cout << a << endl;
- cout << b << endl;
- float c = -10;
- float d = 0;
- ZAMIANA(c, d);
- cout << c << endl;
- cout << d << endl;
- float e = 3.1415;
- float f = 999;
- ZAMIANA(e, f);
- cout << e << endl;
- cout << f << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement