Mauzzz0

Task 10.2

Nov 20th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. void super_swap(int &a, int &b){
  5.     int k = a;
  6.     a = b;
  7.     b = k;
  8. }
  9.  
  10. int main() {
  11.         int a,b;
  12.         cout << "Write integer a" << endl;
  13.         cin >> a;
  14.         cout << "Write integer b" << endl;
  15.         cin >> b;
  16.  
  17.         super_swap(a,b);
  18.  
  19.         cout << "a = " << a << endl;
  20.         cout << "b = " << b << endl;
  21.  
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment