Advertisement
Guest User

Untitled

a guest
Jun 24th, 2020
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace EncryptSortAndPrintArray
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. int n = int.Parse(Console.ReadLine());
  11. int sumVowels = 0;
  12. int sumConsonant = 0;
  13. int sum = 0;
  14.  
  15. int[] arrayOfSums = new int[n];
  16.  
  17. for (int i = 0; i < n; i++)
  18. {
  19.  
  20. string name = Console.ReadLine();
  21. for (int j = 0; j < name.Length; j++)
  22. {
  23. int currentLetter = name[j];
  24. if (currentLetter == 97 || currentLetter == 101 || currentLetter == 105 || currentLetter == 111 || currentLetter == 117
  25. || currentLetter == 65 || currentLetter == 69 || currentLetter == 73 || currentLetter == 79 || currentLetter ==85)
  26. {
  27. sumVowels += currentLetter * name.Length;
  28. }
  29. else
  30. {
  31. sumConsonant += currentLetter / name.Length;
  32. }
  33. }
  34. sum = sumVowels + sumConsonant;
  35. arrayOfSums[i] = sum;
  36.  
  37. sumVowels = 0;
  38. sumConsonant = 0;
  39. sum = 0;
  40.  
  41.  
  42.  
  43. }
  44.  
  45. Array.Sort(arrayOfSums);
  46. for (int i = 0; i < arrayOfSums.Length; i++)
  47. {
  48. Console.WriteLine(arrayOfSums[i]);
  49. }
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement