Guest User

Untitled

a guest
May 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import java.util.Arrays;
  2.  
  3. public class Plugga {
  4. public static void main (String[]args){
  5. int[] talen = {12, 814, 37, 116, 334, 418, 7, 274};
  6. Arrays.sort(talen);
  7.  
  8. int[] newArr = int[talen.length];
  9.  
  10. int b = 0;
  11. for ( int x = 0; x < talen.length/2; x++){
  12. newArr[b] = talen[x];
  13. newArr[++b] = talen[talen.length-(x+1)];
  14.  
  15. }
  16. System.out.println(newArr);
  17. }
  18. }
Add Comment
Please, Sign In to add comment