Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Arrays;
- public class taskCh11N245 {
- public static void main(String[] args) {
- int[] arr = {-1,-2,-3,3,2,-2,4,0,1,-5};
- int[] fin = new int[arr.length];
- int head = 0;
- int tail = arr.length - 1;
- for (int i = 0; i < arr.length; i++) {
- if (arr[i] > 0)
- fin[head++] = arr[i];
- else
- fin[tail--] = arr[i];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement