limonchesled

01. Encrypt, Sort and Print Array

Feb 26th, 2024
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. namespace _01._Encrypt__Sort_and_Print_Array
  2. {
  3. internal class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. int n = int.Parse(Console.ReadLine());
  8. string[] input = new string[n];
  9. int[] sum = new int[n];
  10. for (int i = 0; i < n; i++)
  11. {
  12. input[i] = Console.ReadLine();
  13. int currentSum = 0;
  14. for (int j = 0; j < input[i].Length; j++)
  15. {
  16. if ( input[i][j] == 'a' || input[i][j] == 'e' || input[i][j] == 'i' || input[i][j] == 'o' || input[i][j] == 'u')
  17. {
  18. currentSum += input[i][j] * input[i].Length;
  19. }
  20. else
  21. {
  22. currentSum += input[i][j] / input[i].Length;
  23. }
  24. }
  25. sum[i] = currentSum;
  26. }
  27. Array.Sort(sum);
  28. foreach (int i in sum)
  29. {
  30. Console.WriteLine(i);
  31. }
  32.  
  33. }
  34. }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment