Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace OOPFirstLab
  5. {
  6. class MainClass
  7. {
  8. public static void Main(string[] args)
  9. {
  10.  
  11. string value;
  12. value = Console.ReadLine();
  13. Console.WriteLine("________________________");
  14. Console.WriteLine("|Символ| |Код|");
  15. for (int i = 0; i < value.Length; i++)
  16.  
  17.  
  18. {
  19. // Convert the string into a byte[].
  20. byte[] asciiBytes = Encoding.ASCII.GetBytes(value);
  21.  
  22. Console.WriteLine("________________________");
  23. Console.WriteLine("| " + value.Substring(i, 1) + " | as ASCII |" + asciiBytes[i] + "|");
  24. //Console.WriteLine("________________________");
  25. }
  26. Console.WriteLine("________________________");
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement