-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArray3.java
More file actions
36 lines (28 loc) · 837 Bytes
/
Array3.java
File metadata and controls
36 lines (28 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package Algo_lab2;
import java.util.Arrays;
import java.util.Scanner;
public class Array3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N = 0;
double[] array = new double[6];
System.out.println("Enter : ");
for (int i = 0; i < array.length; i++) {
array[i] = scanner.nextDouble();
}
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array.length; j++){
if (array[i] == array[j]){
N++;
}
}
if (N != 0){
System.out.println(array[i] + "\t" + N);
N = 0;
}
}
for (int i = 0; i < array.length; i++) {
System.out.println(array[i]);
}
}
}