Advertisement
Iv555

Untitled

Jun 12th, 2022
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7.  
  8. namespace shano
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             Dictionary<string, int> message = new Dictionary<string, int>();
  15.  
  16.             message.Add("A", 65);
  17.             message.Add("B", 66);
  18.             message.Add("C", 67);
  19.             message.Add("D", 68);
  20.             message.Add("E", 69);
  21.             message.Add("F", 70);
  22.             message.Add("G", 71);
  23.             message.Add("H", 72);
  24.             message.Add("I", 73);
  25.             message.Add("J", 74);
  26.             message.Add("K", 75);
  27.             message.Add("L", 76);
  28.             message.Add("M", 77);
  29.             message.Add("N", 78);
  30.             message.Add("O", 79);
  31.             message.Add("P", 80);
  32.             message.Add("Q", 81);
  33.             message.Add("R", 82);
  34.             message.Add("S", 83);
  35.             message.Add("T", 84);
  36.             message.Add("U", 85);
  37.             message.Add("V", 86);
  38.             message.Add("W", 87);
  39.             message.Add("X", 88);
  40.             message.Add("Y", 89);
  41.             message.Add("Z", 90);
  42.  
  43.             string inputText = (Console.ReadLine()).ToUpper();
  44.             string[] inputParameter = new string[inputText.Length];
  45.             //pylnim masiva
  46.             for (int i = 0; i < inputText.Length; i++)
  47.             {
  48.                 inputParameter[i] = inputText[i].ToString();
  49.                 if (message.ContainsKey(inputParameter[i]))
  50.                 {
  51.                     Console.Write(message[inputParameter[i]] + " ");
  52.                 }
  53.             }
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement