Nikolay_Kashev

Index of letters

Apr 20th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Index_of_Letters
  5. {
  6.     class Array
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string str = Console.ReadLine();
  11.             int n = 31;
  12.  
  13.             for (int i = 0; i < str.Length; i++)
  14.             {
  15.                 int result = (str[i] & n) - 1;
  16.                 Console.WriteLine( str[i] + " -> " + result);
  17.             }
  18.         }
  19.     }
  20. }
Add Comment
Please, Sign In to add comment