lundi 29 juin 2020

Random number Array sorted out

For school i making a project for java, right now i got some problems..

I have to sort it out into a collum 10 on the X 10000(rows) on the Y Next to that i have to sort this out..

I hope someone can help me with my problem, i searched everywhere, but i can't find how to do both.

import java.util.Arrays;
import java.util.Random;
import java.io.*;

public class MijnLoop7 
{
    public static void main(String[] args) throws IOException
    {
        Random rand = new Random();
        int[] integers = new int[10];
        int min = 0;
        int max = 100000;
        int aantal = 100000;
        int random = (int) (Math.random()*((aantal-min)+1))+min;
        
        for(int x=0; x<max; x++){
            for(int y=0; y<10; y++)
                integers[y] = rand.nextInt(100000);
            System.out.println(Arrays.toString(integers));
        }
    }
}



Aucun commentaire:

Enregistrer un commentaire