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 SquareNumbers
- {
- class CountNumberts
- {
- static void Main()
- {
- List<int> nums = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- int[] countNums = new int[1001];
- foreach(int n in nums)
- {
- countNums[n]++;
- }
- for (int i = 0; i < countNums.Length; i++)
- {
- if(countNums[i] > 0)
- {
- Console.WriteLine("{0} -> {1}",i,countNums[i]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment