Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- namespace _5.DecryptingMessage
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*You will receive a key (integer) and n characters afterward. Add the key to each of the characters and append them to a message. At the end print the message, which you decrypted. */
- int key = int.Parse(Console.ReadLine());
- int lines = int.Parse(Console.ReadLine());
- StringBuilder message = new StringBuilder();
- for (int i = 0; i < lines; i++)
- {
- char input = char.Parse(Console.ReadLine());
- message.Append((char)(input + key));
- }
- Console.WriteLine(message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment