Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- namespace strong_number
- {
- class Program
- {
- static void Main()
- {
- char first = GetInput_Char();
- char last = GetInput_Char();
- int FirstIndex = 0;
- int LastIndex = 0;
- Console.WriteLine();
- // line all ascii chars
- char[] ASCII = new char[255];
- char[] Chars = new char[255];
- for (int i = 0; i < 255; i++)
- {
- ASCII[i] = (char)i;
- if (first == (char)i) { FirstIndex = i; }
- if (last == (char)i) { LastIndex = i; }
- }
- if (first < last)
- {
- for (int i = FirstIndex + 1; i < LastIndex; i++)
- {
- Console.Write($"{ASCII[i]} ");
- }
- }
- if (first > last)
- {
- int temp = FirstIndex;
- FirstIndex = LastIndex;
- LastIndex = temp;
- for (int i = FirstIndex + 1; i < LastIndex; i++)
- {
- Console.Write($"{ASCII[i]} ");
- }
- }
- }
- static char GetInput_Char() { return Console.ReadLine()[0]; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement