Opzione 2
This commit is contained in:
parent
8bd4398e08
commit
3338996751
14
Program.cs
14
Program.cs
@ -31,7 +31,12 @@ class Program {
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
|
if (array != null) {
|
||||||
|
StampaArray(array);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Console.WriteLine("Errore: è necessario creare l'array prima di mostrarlo.");
|
||||||
|
}
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
@ -83,5 +88,10 @@ class Program {
|
|||||||
return ritorno;
|
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