Opzione 1
This commit is contained in:
parent
dbc865b3c7
commit
5f2e5f314c
24
Program.cs
24
Program.cs
@ -30,7 +30,8 @@ class Program
|
||||
case 1:
|
||||
Console.Clear();
|
||||
array = CreaArrayCasuale();
|
||||
StampaArray(array);
|
||||
StampaArrayZigZag(array);
|
||||
Pausa();
|
||||
break;
|
||||
case 2:
|
||||
Console.Clear();
|
||||
@ -89,9 +90,24 @@ class Program
|
||||
return ritorno;
|
||||
}
|
||||
|
||||
static void StampaArray(int [] p_insieme) {
|
||||
for (int j=0; j<p_insieme.Length; j++){
|
||||
Console.WriteLine("Elemento " +j+ ": " +p_insieme[j]);
|
||||
static void StampaArray(int [] p_array) {
|
||||
for (int j=0; j<p_array.Length; j++){
|
||||
Console.WriteLine("Elemento " +j+ ": " +p_array[j]);
|
||||
}
|
||||
}
|
||||
|
||||
static void StampaArrayZigZag(int[] p_array){
|
||||
int j=dimensione-1, k=0;
|
||||
for (int i=0; i<dimensione; i++){
|
||||
Console.Write("Elemento " + i + ": ");
|
||||
if(i%2!=0){
|
||||
Console.WriteLine(p_array[j]);
|
||||
j--;
|
||||
}
|
||||
else{
|
||||
Console.WriteLine(p_array[k]);
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("array_funzioni_4")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+097f3a4c93bebed479fb2426ed34e92ed4a21c8c")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+dbc865b3c78a32f557c013629494305cc9facffb")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("array_funzioni_4")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("array_funzioni_4")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
2e185c028709242e0e13501e91f3c04f56d804222a54c2c1bd15e6e0f5c04cde
|
||||
b2b910420808c412e0672626769c980cd8ccb42c4a7b33086fa2128f8e85f3d4
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user