Advertisement
Guest User

3311

a guest
Oct 24th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<climits>
  3. int main()
  4. {
  5.   int n, max = INT_MIN, count = 0;
  6.   scanf("%d", &n);
  7.   int a[n];
  8.   for (int i = 0; i < n; i++)
  9.   {
  10.     scanf("%d",&a[i]);
  11.     if (a[i] > max)
  12.     {
  13.       max = a[i];
  14.       count = 0;
  15.     }
  16.     if (a[i] == max)
  17.     {
  18.       count++;
  19.     }
  20.   }
  21.   printf("%d", count);
  22.   return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement