Advertisement
MZlatev

Untitled

Oct 18th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _3._CharactersInRange
  4. {
  5. class CharactersInRange
  6. {
  7. static void Main()
  8. {
  9. char firstInput = char.Parse(Console.ReadLine());
  10. char secondInput = char.Parse(Console.ReadLine());
  11.  
  12. PrintTheCharsBetweenTwoChars(firstInput, secondInput);
  13. }
  14.  
  15. private static void PrintTheCharsBetweenTwoChars(char firstCharacter, char secondCharacter)
  16. {
  17. int startCharacter = Math.Min(firstCharacter, secondCharacter);
  18. int endCharacter = Math.Max(firstCharacter, secondCharacter);
  19.  
  20. for (int i = ++startCharacter; i < endCharacter; i++)
  21. {
  22. Console.Write((char)i + " ");
  23. }
  24.  
  25. Console.WriteLine();
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement