Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- string data = "";
- int[] result = new int[n];
- char[] vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'};
- char[] consonants = {'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z', 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z', 'y', 'Y'};
- //Console.WriteLine(consonants[1]);
- int res = 0;
- for (int i = 1; i <= n; i++)
- {
- data = Console.ReadLine();
- for (int j = 0; j < data.Length; j++)
- {
- //if(data[j] >= 65 && data[j] <= 90 || data[j] >= 97 && data[j] <= 122){
- var isVowel = false;
- for (int k = 0; k < vowels.Length; k++)
- {
- if (data[j] == vowels[k])
- {
- res += (int)vowels[k] * data.Length;
- isVowel = true;
- }
- }
- if (isVowel) continue; //ако е- към следващия char
- res += (int)data[j] / data.Length;
- //}
- }
- result[i - 1] = res;
- res = 0;
- }
- for (int elem = 0; elem < result.Length - 1; elem++)
- {
- for (int swp = elem + 1; swp < result.Length; swp++)
- {
- int temp = 0;
- if (result[elem] > result[swp])
- {
- temp = result[elem];
- result[elem] = result[swp];
- result[swp] = temp;
- }
- }
- }
- foreach (var item in result)
- {
- Console.WriteLine(item);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement