Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class test {
- static int k = 0;
- static int max = Integer.MIN_VALUE;
- static void d() {
- Scanner in = new Scanner(System.in);
- int n = in.nextInt();
- if (n != 0) {
- if (n > max) {
- max = n;
- k = 0;
- }
- if (n == max) k++;
- d();
- }
- }
- public static void main(String[] args) {
- d();
- System.out.print(k);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement