kirililchev3

Print ASCII table symbol

May 27th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P17_PrintPartOfTheASCIITable
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             char startChar = (char)int.Parse(Console.ReadLine());
  10.             char endChar = (char)int.Parse(Console.ReadLine());
  11.             OutputCharInterval(startChar, endChar);
  12.         }
  13.  
  14.         static void OutputCharInterval(char startChar, char endChar)
  15.         {
  16.             if (startChar < endChar)
  17.             {
  18.                 Console.Write($"{startChar} ");
  19.                 OutputCharInterval((char)(startChar + 1), endChar);
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine($"{startChar}");
  24.             }
  25.  
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment