diff --git a/Program.cs b/Program.cs index 0ed7c5b..d7bda74 100644 --- a/Program.cs +++ b/Program.cs @@ -5,9 +5,10 @@ class Program static void Main(string[] args) { //dichiarazione e inizializzazione variabili - int scelta, i, numero, somma, tmp; + int scelta, i, numero, somma, tmp, multipliDiTre; somma = 0; tmp = 0; + multipliDiTre = 0; bool positiviPari, positivoNegativo; positiviPari = true; positivoNegativo = false; @@ -80,7 +81,25 @@ class Program } break; case 4: - break; + somma = 0; + do{ + Console.Write("Numeri da inserire: "); + i = Convert.ToInt32(Console.ReadLine()); + if (i <= 0){ + Console.WriteLine("Opzione non valida"); + } + } + while (i <= 0); + for (; i > 0; i--){ + Console.Write("Inserire un numero: "); + numero = Convert.ToInt32(Console.ReadLine()); + if(numero % 3 == 0){ //se è divisibile per 3 + somma = somma + numero; + multipliDiTre++; + } + } + Console.WriteLine("La media è " + (somma/multipliDiTre)); + break; default: Console.WriteLine("Opzione non valida"); Console.WriteLine("Premere un tasto per continuare. . ."); diff --git a/bin/Debug/net9.0/ripasso1.dll b/bin/Debug/net9.0/ripasso1.dll index c3eb841..303fb79 100644 Binary files a/bin/Debug/net9.0/ripasso1.dll and b/bin/Debug/net9.0/ripasso1.dll differ diff --git a/bin/Debug/net9.0/ripasso1.pdb b/bin/Debug/net9.0/ripasso1.pdb index 2cfb8ca..01a997b 100644 Binary files a/bin/Debug/net9.0/ripasso1.pdb and b/bin/Debug/net9.0/ripasso1.pdb differ diff --git a/obj/Debug/net9.0/ref/ripasso1.dll b/obj/Debug/net9.0/ref/ripasso1.dll index 8dcb25c..27eb815 100644 Binary files a/obj/Debug/net9.0/ref/ripasso1.dll and b/obj/Debug/net9.0/ref/ripasso1.dll differ diff --git a/obj/Debug/net9.0/refint/ripasso1.dll b/obj/Debug/net9.0/refint/ripasso1.dll index 8dcb25c..27eb815 100644 Binary files a/obj/Debug/net9.0/refint/ripasso1.dll and b/obj/Debug/net9.0/refint/ripasso1.dll differ diff --git a/obj/Debug/net9.0/ripasso1.AssemblyInfo.cs b/obj/Debug/net9.0/ripasso1.AssemblyInfo.cs index 1f824c7..8fba4ae 100644 --- a/obj/Debug/net9.0/ripasso1.AssemblyInfo.cs +++ b/obj/Debug/net9.0/ripasso1.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("ripasso1")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+018f63991bf194f27f28e5f478eb7c5a8784aa89")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+fae57d0cae3376b1ff9486afec2b6c50157b982f")] [assembly: System.Reflection.AssemblyProductAttribute("ripasso1")] [assembly: System.Reflection.AssemblyTitleAttribute("ripasso1")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net9.0/ripasso1.AssemblyInfoInputs.cache b/obj/Debug/net9.0/ripasso1.AssemblyInfoInputs.cache index 14564c8..1cc1ffc 100644 --- a/obj/Debug/net9.0/ripasso1.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/ripasso1.AssemblyInfoInputs.cache @@ -1 +1 @@ -042eecfbc24d3d06289088724a32fc5b4299d5aefd8aabe9fff63f62e1ef4676 +88522e7ce533ae95f95e2c0548d311b569206cfed9f17b5ec77708383ee1f728 diff --git a/obj/Debug/net9.0/ripasso1.dll b/obj/Debug/net9.0/ripasso1.dll index c3eb841..303fb79 100644 Binary files a/obj/Debug/net9.0/ripasso1.dll and b/obj/Debug/net9.0/ripasso1.dll differ diff --git a/obj/Debug/net9.0/ripasso1.pdb b/obj/Debug/net9.0/ripasso1.pdb index 2cfb8ca..01a997b 100644 Binary files a/obj/Debug/net9.0/ripasso1.pdb and b/obj/Debug/net9.0/ripasso1.pdb differ