Advertisement
Stan0033

Untitled

Jun 22nd, 2021
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace strong_number
  5. {
  6. class Program
  7. {
  8. static void Main()
  9. {
  10.  
  11. char first = GetInput_Char();
  12. char last = GetInput_Char();
  13. int FirstIndex = 0;
  14. int LastIndex = 0;
  15. Console.WriteLine();
  16. // line all ascii chars
  17. char[] ASCII = new char[255];
  18. char[] Chars = new char[255];
  19. for (int i = 0; i < 255; i++)
  20. {
  21. ASCII[i] = (char)i;
  22.  
  23.  
  24. if (first == (char)i) { FirstIndex = i; }
  25. if (last == (char)i) { LastIndex = i; }
  26. }
  27.  
  28.  
  29. if (first < last)
  30. {
  31. for (int i = FirstIndex + 1; i < LastIndex; i++)
  32. {
  33. Console.Write($"{ASCII[i]} ");
  34. }
  35. }
  36. if (first > last)
  37. {
  38. int temp = FirstIndex;
  39. FirstIndex = LastIndex;
  40. LastIndex = temp;
  41.  
  42. for (int i = FirstIndex + 1; i < LastIndex; i++)
  43. {
  44. Console.Write($"{ASCII[i]} ");
  45. }
  46. }
  47.  
  48.  
  49.  
  50.  
  51. }
  52.  
  53. static char GetInput_Char() { return Console.ReadLine()[0]; }
  54.  
  55.  
  56.  
  57.  
  58.  
  59. }
  60. }
  61.  
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement