Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Random100 {
- public static void main(String[] args) {
- int[] a = new int[100];
- Random r = new Random();
- for (int i = 0; i < a.length; i++)
- a[i] = r.nextInt(10);
- int count5 = 0;
- for (int e : a)
- if (e == 5)
- count5++;
- System.out.println(count5);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement