diff --git a/Program.cs b/Program.cs index 4c4f5ad..00101f7 100644 --- a/Program.cs +++ b/Program.cs @@ -4,8 +4,9 @@ class Program { static void Main(string[] args) { - //dichiarazione variabili - int scelta, i, numero; + //dichiarazione e inizializzazione variabili + int scelta, i, numero, somma; + somma = 0; bool positiviPari = true; //menu do { @@ -22,24 +23,22 @@ class Program case 0: break; case 1: - do - { + do{ Console.Write("Numeri da inserire: "); i = Convert.ToInt32(Console.ReadLine()); - if (i <= 0) - { + if (i <= 0){ Console.WriteLine("Opzione non valida"); } } while (i <= 0); - for(; i > 0; i--){ + for (; i > 0; i--){ Console.Write("Inserire un numero: "); numero = Convert.ToInt32(Console.ReadLine()); if(numero < 0 || numero % 2 != 0){ positiviPari = false; } } - if(positiviPari == true){ + if (positiviPari == true){ Console.WriteLine("Tutti positivi e pari"); } else{ @@ -47,7 +46,16 @@ class Program } break; case 2: - break; + do{ + Console.Write("Inserire un numero: "); + numero = Convert.ToInt32(Console.ReadLine()); + if (!((numero < 0 && numero % 2 == 0) || (numero >= 0 && numero % 3 == 0))){ + somma = somma + numero; + } + } + while (!((numero < 0 && numero % 2 == 0) || (numero >= 0 && numero % 3 == 0))); + Console.WriteLine("Somma: " + somma); + break; case 3: break; case 4: diff --git a/bin/Debug/net9.0/ripasso1.dll b/bin/Debug/net9.0/ripasso1.dll index 578013a..e479168 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 218adb1..5800ae7 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 6fbb18d..383a780 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 6fbb18d..383a780 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 56944e5..d082391 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+523bb24b6cdf5fe528dfd83a3e99519698c6b70f")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e1c4d5e33e3928d02e8d2d8c5dad601ee6a069b7")] [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 5717ede..076d1cd 100644 --- a/obj/Debug/net9.0/ripasso1.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/ripasso1.AssemblyInfoInputs.cache @@ -1 +1 @@ -9ae844eabdb834620e40c9ba6eb3b842d15c778fa257263021e9ad9254162faf +f2c5cde86cd7c9aecef2ceb3af53f8d967d88c13fffb33996563a5258c59d278 diff --git a/obj/Debug/net9.0/ripasso1.dll b/obj/Debug/net9.0/ripasso1.dll index 578013a..e479168 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 218adb1..5800ae7 100644 Binary files a/obj/Debug/net9.0/ripasso1.pdb and b/obj/Debug/net9.0/ripasso1.pdb differ