Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. public class Solution
  2. {
  3. public static void main(String[] args) throws Exception
  4. {
  5. int[] bMas = new int[20];
  6.  
  7. int[] lMas = new int[10];
  8. int[] lMas2 = new int[10];
  9.  
  10. Scanner in = new Scanner(System.in);
  11.  
  12. for(int i = 0; i < bMas.length; i++)
  13. {
  14. bMas[i] = in.nextInt();
  15. }
  16. // 0 10
  17. for(int i = 0; i < 10; i++)
  18. {
  19. lMas[10 - i] = bMas[10];
  20. }
  21. //10 20
  22. for(int i = 10; i < bMas.length; i++)
  23. {
  24. lMas2[10 - i] = bMas[20];
  25. //Here he must outprint hes vallue
  26. System.out.println(lMas2[i]);
  27. }
  28.  
  29.  
  30. }
  31.  
  32.  
  33. }
  34.  
  35. lMas[] = Arrays.copyOfRange(bMas, 0, 10);
  36. lMas2[] = Arrays.copyOfRange(bMas, 10, 20);
  37.  
  38. for(int i = 0; i < 10; i++)
  39. {
  40. lMas[10 - i] = bMas[10];
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement