Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7.  
  8. namespace ConsoleApp1
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. int[] arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  15. int broi = 1;
  16. int nai_golqm_broi=0, nai_chesto_sreshtan_el=0, el_za_proverka;
  17. for (int i = 0; i < arr.Length-1; i++)
  18. {
  19. el_za_proverka = arr[i];
  20. for (int j = i+1; j < arr.Length; j++)
  21. {
  22.  
  23. if (el_za_proverka == arr[j]) broi++;
  24. if (broi > nai_golqm_broi) { nai_golqm_broi = broi; nai_chesto_sreshtan_el = arr[i];}
  25.  
  26. }
  27. broi = 1;
  28. }
  29. Console.WriteLine(nai_chesto_sreshtan_el);
  30.  
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement