Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CharactersInRange
- {
- class Program
- {
- static void Main(string[] args)
- {
- char ch1 = char.Parse(Console.ReadLine());
- char ch2 = char.Parse(Console.ReadLine());
- string result = "";
- Console.WriteLine(CharactersInRange(ch1, ch2, result));
- }
- private static string CharactersInRange(char ch1, char ch2, string result)
- {
- int small = 0;
- int big = 0;
- if (ch1 < ch2)
- {
- small = ch1;
- big = ch2;
- }
- else
- {
- small = ch2;
- big = ch1;
- }
- for (int i = small + 1; i < big; i++)
- {
- result += $"{(char)i} ";
- }
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement