Advertisement
vov44k

Untitled

Mar 12th, 2022 (edited)
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class test {
  4.     static int k = 0;
  5.     static int max = Integer.MIN_VALUE;
  6.  
  7.     static void d() {
  8.         Scanner in = new Scanner(System.in);
  9.  
  10.         int n = in.nextInt();
  11.         if (n != 0) {
  12.             if (n > max) {
  13.                 max = n;
  14.                 k = 0;
  15.             }
  16.             if (n == max) k++;
  17.             d();
  18.         }
  19.     }
  20.  
  21.     public static void main(String[] args) {
  22.         d();
  23.         System.out.print(k);
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement