From 19bcef7b32ce02a024c2dc77b5821602ee461441 Mon Sep 17 00:00:00 2001 From: La Programmatrice Verde Date: Wed, 26 Feb 2025 09:37:51 +0100 Subject: [PATCH] Opzione 4 --- Program.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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