Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<cstdio>
  2. #include<algorithm>
  3. using namespace std;
  4. int arr[10000],arr2[10000],z,h,temp,e,p,r,y;
  5. char x,v,w,q,a,b;
  6. int bola()
  7. {
  8.  
  9. scanf("%d",&p);
  10. for(int i=1;i<=p;i++)
  11. {
  12. scanf("%d",&arr[i]);
  13. }
  14. for(int j=1;j<=p;j++)
  15. {
  16. scanf("%d",&arr2[j]);
  17. }
  18. scanf("%d",&r);
  19. for( int f=1;f<=r;f++)
  20. {
  21.  
  22. swap(arr[z],arr2[h]);
  23.  
  24. }
  25. for(int k=1;k<=p;k++)
  26. {
  27. printf("%d ",arr[k]);
  28. }
  29. printf("\n");
  30. for(int u=1;u<=p;u++)
  31. {
  32. printf("%d ",arr2[u]);
  33. }
  34. printf("\n");
  35. }
  36. int main()
  37. {
  38. bola();
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement