-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathG 847 - University Classes.java
52 lines (47 loc) · 1.45 KB
/
G 847 - University Classes.java
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import java.util.Scanner;
public class University_Classes {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int [] data = new int [7];
String x;
long in = input.nextLong();
input.nextLine();
for (int i = 0; i < in; i++) {
x = input.nextLine();
for (int j = 0; j < 7; j++) {
if (Character.getNumericValue(x.charAt(j)) == 1) {
switch (j) {
case 0:
data[0]++;
break;
case 1 :
data[1]++;
break;
case 2:
data[2]++;
break;
case 3 :
data[3]++;
break;
case 4:
data[4]++;
break;
case 5 :
data[5]++;
break;
case 6:
data[6]++;
break;
}
}
}
}
int max = data[0];
for (int i = 1; i < data.length; i++) {
if(data [i] > max){
max = data [i];
}
}
System.out.println(max);
}
}