|
|
вернуться в форумOnly latin letters??? Послано AndryS 30 июн 2007 03:41 Also what here it is wrong??? You see only latin letters!! using System; class Program { static void Main(string[] args) { string s = Console.ReadLine();
if (s != null) { int[] s1 = new int[s.Length]; int[] s3 = new int[s.Length]; string s2 = "abcdefghijklmnopqrstuvwxyz"; int tmp = 26; for (int i = 0; i < s.Length; i++) { if (i == 0) { s1[i] = s2.IndexOf(s[i]); if (s1[i] <= 4) { s1[i] += 26; } } else { s1[i] = s2.IndexOf(s[i]); while (s1[i] < s1[i - 1]) { s1[i] += tmp; } } } tmp = s1[1]; int tmp1; s1[1] -= s1[0]; for (int i = 2; i < s1.Length; i++) { tmp1 = s1[i]; s1[i] -= tmp; tmp = tmp1; } s = ""; s1[0] -= 5; for (int i = 0; i < s1.Length; i++) { s += s2[s1[i]]; } } Console.WriteLine(s);
} } |
|
|