Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Practice
- {
- class Program
- {
- static void Main()
- {
- List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
- list.Sort();
- int currentNumber = int.MinValue;
- for (int i = 0; i < list.Count; i++)
- {
- int counter = 0;
- for (int j = 0; j < list.Count; j++)
- {
- if (list[i] == list[j])
- {
- counter++;
- }
- }
- if (list[i] != currentNumber)
- {
- currentNumber = list[i];
- Console.WriteLine("{0} -> {1}", currentNumber, counter);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment