Facebook
From Karol, 3 Years ago, written in Java.
Embed
Download Paste or View Raw
Hits: 74
  1. import java.util.Arrays;
  2.  
  3. public class laczenieTablic {
  4.  
  5.     public static void main(String[] args){
  6.     int[] tab1 = { 1, 2, 7, 8, 9 };
  7.     int[] tab2 = { 6, 3, 2, 9, 6 };
  8.  
  9.     int tab1Length = tab1.length;
  10.     int tab2Length = tab2.length;
  11.     int[] tabLaczone = new int[tab1Length + tab2Length];
  12.  
  13.     System.arraycopy(tab1,0 , tabLaczone, 0, tab1Length);
  14.     System.arraycopy(tab2, 0, tabLaczone, tab1Length, tab2Length);
  15.  
  16.     Arrays.sort(tabLaczone);
  17.  
  18.     System.out.println(Arrays.toString(tabLaczone));
  19.  
  20.     }
  21. }