Advertisement
Thewest123

171110 Černý3

Nov 16th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _171110_Černý3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.BackgroundColor = ConsoleColor.White;
  14.             Console.ForegroundColor = ConsoleColor.Black;
  15.             Console.CursorVisible = false;
  16.             Console.Clear();
  17.  
  18.             char[] znaky = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' };
  19.  
  20.             foreach (char znak in znaky)
  21.             {
  22.                 string hexadecimalne = Convert.ToByte(znak).ToString("x2");
  23.                 string cislem = Convert.ToByte(znak).ToString("");
  24.                 string unikod = Convert.ToByte(znak).ToString("x4");
  25.  
  26.                 Console.WriteLine($"{znak} {cislem}");
  27.  
  28.                 Console.WriteLine($"znakem = '{znak}'; <> {znak}");
  29.                 Console.WriteLine($"hexadecimalne = '\\x00{hexadecimalne}'; <> {znak}");
  30.                 Console.WriteLine($"cislem = (char){cislem}; <> {znak}");
  31.                 Console.WriteLine($"unikod = '\\u{unikod}'; <> {znak}\n\n");
  32.  
  33.             }
  34.  
  35.             Console.Write("Odenteruj!");
  36.             Console.ReadLine();
  37.         }
  38.  
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement