diff --git a/Program.cs b/Program.cs index 3483da4..19bb67a 100644 --- a/Program.cs +++ b/Program.cs @@ -40,6 +40,7 @@ class Program { break; case 4: Console.Clear(); + Codifica(); Pausa(); break; case 5: @@ -102,4 +103,15 @@ class Program { } Console.WriteLine(); } + + static void Codifica() { + string stringa = Input(); + Console.Write("Inserire un numero: "); + int codice = Convert.ToInt32(Console.ReadLine()); + + for (int i = 0; i < stringa.Length; i++) { + Console.Write(Convert.ToChar(stringa[i] + codice)); + } + Console.WriteLine(); + } } \ No newline at end of file