Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Arrays;
- import java.util.Scanner;
- /**
- * Created by Alex on 26.02.2015.
- */
- public class Massive {
- public static void main(String[] args) {
- int m[] = new int[12];
- for (int j = 0; j < 1; ) {
- int countPlus = 0;
- int cjuntMinus =0;
- for (int i = 0; i < m.length; ) {
- m[i] = ((int) ((Math.random() * 21) - 10));
- if (m[i] > 0) {
- i++;
- countPlus++;
- } else if (m[i] < 0){
- i++;
- cjuntMinus++;}
- }
- if (countPlus == cjuntMinus) {
- j++;
- }
- }
- for (int i = 0; i < m.length; i++) {
- System.out.print(m[i] + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement