Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Advanced
- {
- class Program
- {
- static void Main(string[] args)
- {
- var numbers = Console.ReadLine()
- .Split()
- .Select(double.Parse)
- .ToArray();
- var counts = new Dictionary<double, int>();
- foreach (var number in numbers)
- {
- if (!counts.ContainsKey(number))
- {
- counts[number] = 0;
- }
- counts[number]++;
- }
- foreach (var number in counts)
- {
- Console.WriteLine($"{number.Key} - {number.Value} times");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement