Advertisement
Guest User

Untitled

a guest
Jun 24th, 2020
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Arrays_Praktice_2
  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. {
  26. sumVowels += currentLetter * name.Length;
  27. }
  28. else
  29. {
  30. sumConsonant += currentLetter / name.Length;
  31. }
  32. }
  33. sum = sumVowels + sumConsonant;
  34. arrayOfSums[i] = sum;
  35.  
  36. sumVowels = 0;
  37. sumConsonant = 0;
  38. sum = 0;
  39.  
  40.  
  41.  
  42. }
  43.  
  44. Array.Sort(arrayOfSums);
  45. for (int i = 0; i < arrayOfSums.Length; i++)
  46. {
  47. Console.WriteLine(arrayOfSums[i]);
  48. }
  49.  
  50.  
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement