Advertisement
Guest User

Untitled

a guest
Dec 10th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. static void Main(String[] args) {
  2.         int n = Convert.ToInt32(Console.ReadLine());
  3.         string[] ar_temp = Console.ReadLine().Split(' ');
  4.         int[] arr = Array.ConvertAll(ar_temp,Int32.Parse);
  5.         Array.Sort(arr);
  6.         Array.Reverse(arr);
  7.        
  8.         int result = 0;
  9.         foreach (var x in arr){
  10.             if (x == arr[0]){
  11.                 result++;
  12.             }
  13.         }
  14.         Console.WriteLine(result);
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement