Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Ege14 {
- public static void main(String [] args){
- Scanner s = new Scanner(System.in);
- int N = s.nextInt();
- int a[] = new int[99];
- for(int i = 0 ; i < 99 ; i++) {
- a[i] = 0;
- }
- for(int i = 0 ; i < N ; i++){
- s.next();
- s.next();
- int p = s.nextInt();
- a[p-1]++;
- }
- int max = 0;
- for(int i = 0 ; i < 99 ; i++ ){
- if(a[i] > max){
- max = a[i];
- }
- }
- for (int i = 0 ; i < 99 ; i++){
- if (a[i] == max){
- System.out.print(i+1 + " " );
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement