Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Encrypt_Sort_and_Print__Array
- {
- class Program
- {
- static void Main(string[] args)
- {
- int countOfNames = int.Parse(Console.ReadLine());
- var Data = new Dictionary<string, int>();
- for (int i= 1;i <=countOfNames;i++)
- {
- string name = Console.ReadLine();
- int points = 0;
- int length = name.Length;
- for (int j = 0; j <length; j++)
- {
- if((name[j]==65)|| (name[j] == 97)||(name[j] == 69)|| (name[j] == 73)|| (name[j] == 79)||(name[j] == 85)|| (name[j] == 111)||(name[j]==117)||(name[j] ==101)|| (name[j] ==105))
- {
- points += name[j] * length;
- }
- else
- {
- points += name[j] / length;
- }
- }
- Data.Add(name, points);
- }
- foreach (var name in Data.OrderBy(x=>x.Value))
- {
- Console.WriteLine($"{name.Value}");
- }
- }
- }
- }
RAW Paste Data