программа дешифровки "Квадрат Полибия" ничего не выводит
Я написал код дешифровщика. Прога должна дешифровать шифр "Квадрат полибия", но она не работает: на вход принимает данные, а на выходе ничего!!! Что делать?
Код:
using System;
namespace ConsoleApplication105
{
class Program
{
class CaesarCipher
{
static void Main(string[] args)
{
int ind;
string s = null;
int num = 0;
char symb = ' ';
char[] one = { 'а', 'б', 'в', 'г', 'д', 'е' };
char[] two = { 'ж', 'з', 'и', 'й', 'к', 'л' };
char[] three = { 'м', 'н', 'о', 'п', 'р', 'с' };
char[] four = { 'т', 'у', 'ф', 'х', 'ц', 'ч' };
char[] five = { 'ш', 'щ', 'ъ', 'ы', 'ь', 'э' };
char[] six = { 'ю', 'я' };
Console.Write("Напишите зашифрованное сообщение: ");
string cyberInf = Console.ReadLine();
char[] mass = cyberInf.ToCharArray();
int[] Aint = new int[mass.Length];
for (int i = 0; i < mass.Length; i++)
{
Aint[i] = Convert.ToInt32(mass[i].ToString());
}
begin:
for (int i1 = 0; i1 < Aint.Length; i1++)
{
ind = Array.IndexOf(Aint, Aint[i1]);
if ((ind % 2) == 0)
{
switch (Aint[i1])
{
case 1:
s = "one";
goto begin;
case 2:
s = "two";
goto begin;
case 3:
s = "three";
goto begin;
case 4:
s = "four";
goto begin;
case 5:
s = "five";
goto begin;
case 6:
s = "six";
goto begin;
}
}
else
{
switch (s)
{
case "one":
symb = one[mass[ind]];
Console.Write(symb);
goto begin;
case "two":
symb = two[mass[ind]];
Console.Write(symb);
goto begin;
case "three":
symb = three[mass[ind]];
Console.Write(symb);
goto begin;
case "four":
symb = four[mass[ind]];
Console.Write(symb);
goto begin;
case "five":
symb = five[mass[ind]];
Console.Write(symb);
goto begin;
case "six":
symb = six[mass[ind]];
Console.Write(symb);
goto begin;
}
}
}
}
}
}
}
Ввод:
31113111
Источник: Stack Overflow на русском