Hello. There is a code of Caesar Cipher with a key, tell me how to organize the issuance of a complete search, i.e. so that there is no key and shows each shift option.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace cezar { class Program { static void Main(string[] args) { int n = 1, key = 1; Console.WriteLine("Введите слово,которое нужно зашифровать:"); string s = Console.ReadLine(); Console.WriteLine("Введите ключ:"); key = Convert.ToInt32(Console.ReadLine()); string s1 = ""; string alfphabet = "АБВГДЕЖЗИКЛМНОПРСТУФХЦЧШЩЬЪЭЮЯ"; int m = alfphabet.Length; for (int i = 0; i < s.Length; i++) { for (int j = 0; j < alfphabet.Length; j++) { if (s[i] == alfphabet[j]) { int temp = j * n + key; while (temp >= m) temp -= m; s1 = s1 + alfphabet[temp]; } } } Console.WriteLine("Зашифрованное слово:" + s1); Console.ReadLine(); } } }