Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Assignment1;
- import java.awt.Checkbox;
- import java.awt.Container;
- import java.util.Scanner;
- public class Problem6 {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int arr[] = new int[11];
- int check[] = new int[1000000];
- for (int i = 0; i < arr.length;) {
- int num = in.nextInt();
- if (check[num] == 4) {
- System.out.println("Plz enter an uniqe number");
- } else {
- arr[i] = num;
- check[arr[i]]++;
- i++;
- }
- }
- for (int i = 0; i < arr.length; i++) {
- System.out.print(arr[i] + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement