Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MyApp
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- {
- int key = int.Parse(Console.ReadLine());
- int n = int.Parse(Console.ReadLine());
- for (int i = 0; i < n; i++)
- {
- char input = char.Parse(Console.ReadLine());
- int shifted = (int)input + key;
- if ((int)input >= 65 & (int)input <= 90)
- {
- if (shifted > 90)
- {
- shifted = 65 + shifted - 91;
- }
- }
- else if ((int)input >= 97 && (int)input <= 122)
- {
- if (shifted > 122)
- {
- shifted = 97 + shifted - 123;
- }
- }
- Console.Write((char)shifted);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement