Advertisement
icatalin

9.10 problema 1

Oct 9th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int schimb(int a,int b)
  7. {
  8.     int aux;
  9.     aux=b;
  10.     b=a;
  11.     a=aux;
  12. }
  13.  
  14. int main()
  15. {
  16.     int a,b,n,i;
  17.     cout<<"n= ";cin>>n;
  18.     for (i=1;i<=n;i++)
  19.     {
  20.     cout<<"a= ";cin>>a;
  21.     cout<<"b= ";cin>>b;
  22.  
  23.     cout<<schimb(a,b);
  24.     cout<<" ";
  25.     cout<<schimb(b,a)<<'\n';
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement