Garusek

Untitled

Jan 8th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void zamien (int *a, int *b)
  6. {
  7.     int pom=*a;
  8.     *a=*b;
  9.     *b=pom;
  10.  
  11. }
  12.  
  13. int main()
  14. {
  15.  
  16.  
  17. int a,b;
  18. cout<<"Wprowadz dwie liczby:"<<endl; cin>>a>>b;
  19.  
  20.  
  21.         zamien(&a,&b);//przekazujemy adresy zmiennych
  22.         cout <<a<<" "<<b<<endl;
  23.  
  24.  
  25.         return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment