-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEle14.java
More file actions
36 lines (31 loc) · 744 Bytes
/
Ele14.java
File metadata and controls
36 lines (31 loc) · 744 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
import java.util.Scanner;
public class Ele14 {
int arr[];
int n;
Ele14() {
Scanner s = new Scanner(System.in);
n = s.nextInt();
arr = new int[n];
for (int i = 0; i < arr.length; i++) {
arr[i] = s.nextInt();
}
}
public boolean result() {
int c = 0;
for (int i = 0; i < n; i++) {
if ((arr[i] == 1) | (arr[i] == 4)) {
c = c + 1;
}
}
if(c==n){
return true;
}
else{
return false;
}
}
public static void main(String[] args) {
Ele14 obj = new Ele14();
System.out.println(obj.result());
}
}