Advertisement
Spocoman

05. Decrypting Message

Jan 19th, 2022
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace DecryptingMessage
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int key = int.Parse(Console.ReadLine());
  10.             int num = int.Parse(Console.ReadLine());
  11.             string print = string.Empty;
  12.  
  13.             for (int i = 0; i < num; i++)
  14.             {
  15.                 int current = char.Parse(Console.ReadLine());
  16.                 print += (char)(current + key);
  17.             }
  18.             Console.WriteLine(print);
  19.         }
  20.     }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement