Opzione 2
This commit is contained in:
parent
8bd4398e08
commit
3338996751
12
Program.cs
12
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]}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user