Advertisement
Iv555

Untitled

Jun 12th, 2022
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 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.            
  15.             Dictionary<string, int> message = new Dictionary<string, int>();
  16.             for (int i = 0; i <= 127; i++)
  17.             {
  18.                 message.Add(Convert.ToChar(i).ToString(), i);
  19.             }
  20.  
  21.             string inputText = Console.ReadLine();
  22.             string[] inputParameter = new string[inputText.Length];
  23.             //pylnim masiva
  24.             for (int i = 0; i < inputText.Length; i++)
  25.             {
  26.                 inputParameter[i] = inputText[i].ToString();
  27.                 if (message.ContainsKey(inputParameter[i]))
  28.                 {
  29.                     Console.Write(message[inputParameter[i]] + " ");
  30.                 }
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement