Opzione 3
This commit is contained in:
parent
be372a37e8
commit
a8ba75c678
11
Program.cs
11
Program.cs
@ -146,6 +146,17 @@ class Program {
|
||||
Console.WriteLine("Il valore minimo è " + min + " mentre il valore massimo è " + max);
|
||||
}
|
||||
static void Media(){
|
||||
int input, temp = 0, i = 1;
|
||||
|
||||
do {
|
||||
Console.Write("Inserire un numero (numero negativo per uscire): ");
|
||||
input = Convert.ToInt32(Console.ReadLine());
|
||||
temp = temp + input; //somma di tutti i valori inseriti
|
||||
if (i>1 && input>0){
|
||||
Console.WriteLine("Media: " + (temp / i));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
while (input>0);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("ripasso3")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3efdd8911e1703151775a922d9fb8d6b4b80d05d")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+be372a37e80b5f33db3f90fa9633f0fab5e810e4")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("ripasso3")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("ripasso3")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
d73a50dabbb49d991ace67ec8edcaa15cf29464cf2168b7c8fae774cd9acccb0
|
||||
984d76e55b057a5f8a99dfccaffad974dfc1272ee4447e584917b2b2bf3541e8
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user