Advertisement
el_ninio

01.Encrypt

Apr 26th, 2019
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _1._Encrypt__Sort_and_Print_Array
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int count = int.Parse(Console.ReadLine());
  10.  
  11. int sum = 0;
  12.  
  13. int currentNum = 0;
  14. string currentSym ="";
  15. int[] array = new int[count];
  16.  
  17. for (int i = 0; i < count; i++)
  18.  
  19. {
  20. string name = Console.ReadLine();
  21. sum = 0;
  22.  
  23. for (int j = 0; j < name.Length; j++)
  24. {
  25. currentSym = name[j]+"";
  26.  
  27. currentNum = name[j];
  28. if (currentSym=="a" || currentSym == "o" || currentSym == "u" || currentSym == "e" || currentSym == "i")
  29. {
  30. currentNum *= name.Length;
  31. }
  32. else
  33. {
  34. currentNum /= name.Length;
  35. }
  36.  
  37. sum += currentNum;
  38.  
  39.  
  40. array[i]=sum;
  41.  
  42. }
  43.  
  44. }
  45. Array.Sort(array);
  46. foreach (var num in array)
  47. {
  48. Console.WriteLine(num);
  49. }
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement