Advertisement
Iskrenov84

03. Characters in Range

Feb 10th, 2022
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P3._CharactersInRange
  4. {
  5.     internal class Program
  6.     {
  7.         static void CharacterInRange (char first, char second)
  8.         {
  9.             int startCharacter = Math.Min(first, second);
  10.             int endCharacter = Math.Max(first, second);
  11.             for (int i = startCharacter + 1; i < endCharacter; i++)
  12.             {
  13.                 Console.Write($"{(char)i} ");
  14.             }
  15.         }
  16.        
  17.         static void Main(string[] args)
  18.         {
  19.             char one = char.Parse(Console.ReadLine());
  20.             char two = char.Parse(Console.ReadLine());
  21.             CharacterInRange(one,two);
  22.             //char symbols=CharacterInRange(first, second);
  23.             //Console.WriteLine(symbols);
  24.             //Console.OutputEncoding = System.Text.Encoding.GetEncoding(28591);
  25.            
  26.         }
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement