import java.util.Random;
public class Math
{
public static void main ( String args[] )
{
Random randomNumbers = new Random();
int number;
bool[] oldnums = new int[50];
for ( int counter = 1; counter <= 30; counter++)
{
while(oldnums[number]){number = 1 + randomNumbers.nextInt( 49 );}
System.out.printf("%d ", number);
if ( counter % 6 == 0 )
System.out.println();
}
}
}
import java.util.Random;
public class Math
{
public static void main ( String args[] )
{
Random randomNumbers = new Random();
int number;
boolean[] oldnums = new int[50];
for ( int counter = 1; counter <= 30; counter++)
{
while(oldnums[number]){number = 1 + randomNumbers.nextInt( 49 );}
System.out.printf("%d ", number);
if ( counter % 6 == 0 )
System.out.println();
}
}
}
import java.util.Random;
public class Math
{
public static void main ( String args[] )
{
Random randomNumbers = new Random();
int number;
boolean[] oldnums = new boolean[50];
for ( int counter = 1; counter <= 30; counter++)
{
while(oldnums[number]){number = 1 + randomNumbers.nextInt( 49 );}
System.out.printf("%d ", number);
if ( counter % 6 == 0 )
System.out.println();
}
}
}
import java.util.Random;
public class Math
{
public static void main ( String args[] )
{
Random randomNumbers = new Random();
int number;
boolean[] oldnums = new boolean[50];
for ( int counter = 1; counter <= 30; counter++){
do{number = 1 + randomNumbers.nextInt( 49 );}while(oldnums[number]);
System.out.printf("%d ", number);
if ( counter % 6 == 0 )
System.out.println();
}
}
}
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
servlet requestdispatcher include and forward differences | 1 | 32 | |
Apps blocked by Java | 9 | 81 | |
fibonacci ten numbers | 4 | 39 | |
hibernate example using maven | 12 | 42 |
Join the community of 500,000 technology professionals and ask your questions.