Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void my_swap(int * a, int * b) {
- int tmp = *a;
- *a = *b;
- *b = tmp;
- }
- int main() {
- int a, b;
- cin >> a >> b;
- my_swap(&a, &b);
- cout << a << " " << b << endl;
- return 0;
- }
- /*
- 5
- 1 2 3 4 5
- 5
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement