Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Most_Frequent_Number
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] arr = Console.ReadLine()
- .Split(' ')
- .Select(int.Parse)
- .ToArray();
- int freq = 0;
- int current = 0;
- for (int i = 0; i < arr.Length; i++)
- {
- freq = arr[0];
- current = arr[i];
- if (current == freq)
- {
- freq = current;
- break;
- }
- }
- Console.WriteLine(freq);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement