From 33389967511e298df58283367becab881e823ffa Mon Sep 17 00:00:00 2001 From: La Programmatrice Verde Date: Thu, 27 Feb 2025 09:56:30 +0100 Subject: [PATCH] Opzione 2 --- Program.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 46507a1..7737d2b 100644 --- a/Program.cs +++ b/Program.cs @@ -31,7 +31,12 @@ class Program { break; case 2: Console.Clear(); - + if (array != null) { + StampaArray(array); + } + else { + Console.WriteLine("Errore: รจ necessario creare l'array prima di mostrarlo."); + } Pausa(); break; case 3: @@ -83,5 +88,10 @@ class Program { return ritorno; } - + static void StampaArray(string[] p_array) { + for (int i = 0; i < p_array.Length; i++) { + Console.WriteLine($"Elemento n.{i + 1}: {p_array[i]}"); + } + } + } \ No newline at end of file