Exemple #1
0
 public override string solve(string s)
 {
     StringBuilder builder = new StringBuilder();
     Table table = new Table();
     table.build();
     int mod = 33;
     for (int iter = 0; iter < mod; ++iter)
     {
         builder.Append((iter - mod) + " ");
         for (int i = 0; i < s.Length; ++i)
         {
             if (s[i] == ' ')
             {
                 builder.Append(" ");
                 continue;
             }
             int index = table.revarr[s[i]];
             index = (index + iter) % mod;
             char ch = table.arr[index];
             builder.Append(ch);
         }
         builder.Append("\n");
     }
     return builder.ToString();
 }
Exemple #2
0
 public override string solve(string s)
 {
     StringBuilder builder = new StringBuilder();
     Table table = new Table();
     table.build(); table.rebuild2();
     for (int i = 0; i < s.Length; ++i)
     {
         if (s[i] == ' ' || s[i] == ',')
         {
             builder.Append(s[i]);
             continue;
         }
         int index = table.revarr1[s[i]];
         if (index == -1) index = table.revarr[s[i]];
         builder.Append(table.arr[index]);
     }
     return builder.ToString();
 }
Exemple #3
0
 public override string solve(string s)
 {
     StringBuilder builder = new StringBuilder();
     Table table = new Table();
     table.build();
     string key = "япомнючудноемгновенье";
     for (int i = 0; i < 5; ++i) key += key;
     int mod = 33;
     int cnt = 0;
     for (int i = 0; i < s.Length; ++i)
     {
         if (s[i] == ' ')
         {
             builder.Append(' ');
             continue;
         }
         int k = table.revarr[key[cnt++]];
         int v = table.revarr[s[i]];
         int val = (v - k + 5 * mod) % mod;
         builder.Append(table.arr[val]);
     }
     return builder.ToString();
 }