Advertisement
Guest User

Untitled

a guest
May 6th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main () {
  4.  
  5. int n, i, j;
  6.  
  7. scanf ("%d", &n);
  8.  
  9. int prvi[n];
  10. int drugi[n];
  11. int treci[n * 2];
  12.  
  13. for (i = 0; i < n; i++){
  14. scanf ("%d", &prvi[i]);
  15. treci[i] = prvi[i];
  16. }
  17.  
  18. for (i = 0; i < n; i++){
  19. scanf ("%d", &drugi[i]);
  20. treci[n + i] = drugi[i];
  21. }
  22.  
  23.  
  24. for (i = 0; i < n * 2; i++){
  25. for (j = i + 1; j < n * 2; j++){
  26. if (treci[i] < treci [j]){
  27. treci[i]^=treci[j];
  28. treci[j]^=treci[i];
  29. treci[i]^=treci[j];
  30. }
  31. }
  32. }
  33.  
  34. for (i = 0; i < n * 2; i++)
  35. printf ("%d ", treci[i]);
  36.  
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement