24 lines
335 B
C++
24 lines
335 B
C++
/*
|
|
FUNKCJA ZAMIEN
|
|
|
|
NAPISZ FUNKCJE ZAMIEN KTORA ZAMIENIA MIEJSCAMI DWIE LICZBY CALKOWITE PRZEZ REFERENCJE
|
|
*/
|
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
void zamien(int &x, int &y) {
|
|
int temp = x;
|
|
x = y;
|
|
y = temp;
|
|
}
|
|
|
|
int main() {
|
|
int x = 5, y = 10;
|
|
|
|
zamien(x, y);
|
|
cout << x << " " << y;
|
|
|
|
return 0;
|
|
}
|