Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Count_Real_Numbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<double> input = Console.ReadLine().Split(' ').Select(double.Parse).ToList();
- var count = new SortedDictionary<double, int>();
- foreach (var num in input)
- {
- if (count.ContainsKey(num))
- {
- count[num]++;
- }
- else
- {
- count[num] = 1;
- }
- }
- foreach (var num in count.Keys)
- {
- Console.WriteLine($"{num} -> {count[num]}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement