Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- int broi = 1;
- int nai_golqm_broi=0, nai_chesto_sreshtan_el=0, el_za_proverka;
- for (int i = 0; i < arr.Length-1; i++)
- {
- el_za_proverka = arr[i];
- for (int j = i+1; j < arr.Length; j++)
- {
- if (el_za_proverka == arr[j]) broi++;
- if (broi > nai_golqm_broi) { nai_golqm_broi = broi; nai_chesto_sreshtan_el = arr[i];}
- }
- broi = 1;
- }
- Console.WriteLine(nai_chesto_sreshtan_el);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement