diff --git a/Program.cs b/Program.cs index 6905a9b..513e820 100644 --- a/Program.cs +++ b/Program.cs @@ -1,9 +1,36 @@ namespace ricorsione_3; -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello, World!"); +class Program { + static void Main(string[] args) { + Console.Write("Quanti numeri inserire? "); + int[] array = new int[Convert.ToInt32(Console.ReadLine())]; + + for (int i = 0; i < array.Length; i++) { + Console.Write($"Inserire il numero n. {i + 1}: "); + array[i] = Convert.ToInt32(Console.ReadLine()); + } + + int max = int.MinValue; + for (int i = 0; i < array.Length; i++) { + if (array[i] > max) { + max = array[i]; + } + } + + Console.WriteLine($"Massimo: {max}"); + Console.WriteLine($"Massimo ricorsivo: {Ricorsione(array, int.MinValue, 0)}"); } + + static int Ricorsione(int[] p_numeri, int p_max, int p_i) { + if (p_i == p_numeri.Length) { + return p_max; + } + else { + if (p_max == int.MinValue || p_numeri[p_i] > p_max) { + p_max = p_numeri[p_i]; + } + } + return Ricorsione(p_numeri, p_max, p_i + 1); + } + } diff --git a/bin/Debug/net9.0/ricorsione_3 b/bin/Debug/net9.0/ricorsione_3 new file mode 100755 index 0000000..b64e55e Binary files /dev/null and b/bin/Debug/net9.0/ricorsione_3 differ diff --git a/bin/Debug/net9.0/ricorsione_3.deps.json b/bin/Debug/net9.0/ricorsione_3.deps.json new file mode 100644 index 0000000..670938d --- /dev/null +++ b/bin/Debug/net9.0/ricorsione_3.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "ricorsione_3/1.0.0": { + "runtime": { + "ricorsione_3.dll": {} + } + } + } + }, + "libraries": { + "ricorsione_3/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/bin/Debug/net9.0/ricorsione_3.dll b/bin/Debug/net9.0/ricorsione_3.dll new file mode 100644 index 0000000..501d1b5 Binary files /dev/null and b/bin/Debug/net9.0/ricorsione_3.dll differ diff --git a/bin/Debug/net9.0/ricorsione_3.pdb b/bin/Debug/net9.0/ricorsione_3.pdb new file mode 100644 index 0000000..64126e4 Binary files /dev/null and b/bin/Debug/net9.0/ricorsione_3.pdb differ diff --git a/bin/Debug/net9.0/ricorsione_3.runtimeconfig.json b/bin/Debug/net9.0/ricorsione_3.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/bin/Debug/net9.0/ricorsione_3.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..9e76325 --- /dev/null +++ b/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/obj/Debug/net9.0/apphost b/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..b64e55e Binary files /dev/null and b/obj/Debug/net9.0/apphost differ diff --git a/obj/Debug/net9.0/ref/ricorsione_3.dll b/obj/Debug/net9.0/ref/ricorsione_3.dll new file mode 100644 index 0000000..1c8c16b Binary files /dev/null and b/obj/Debug/net9.0/ref/ricorsione_3.dll differ diff --git a/obj/Debug/net9.0/refint/ricorsione_3.dll b/obj/Debug/net9.0/refint/ricorsione_3.dll new file mode 100644 index 0000000..1c8c16b Binary files /dev/null and b/obj/Debug/net9.0/refint/ricorsione_3.dll differ diff --git a/obj/Debug/net9.0/ricorsione_3.AssemblyInfo.cs b/obj/Debug/net9.0/ricorsione_3.AssemblyInfo.cs new file mode 100644 index 0000000..32256ce --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_3.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("ricorsione_3")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6f92c18a0f6637cc7273674435c2ab4480bcb5de")] +[assembly: System.Reflection.AssemblyProductAttribute("ricorsione_3")] +[assembly: System.Reflection.AssemblyTitleAttribute("ricorsione_3")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/obj/Debug/net9.0/ricorsione_3.AssemblyInfoInputs.cache b/obj/Debug/net9.0/ricorsione_3.AssemblyInfoInputs.cache new file mode 100644 index 0000000..2442527 --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_3.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +6ee7a83a7bf5bd63fb208ec7bf35df7b72cd982e16fc27673f70de4813181932 diff --git a/obj/Debug/net9.0/ricorsione_3.GeneratedMSBuildEditorConfig.editorconfig b/obj/Debug/net9.0/ricorsione_3.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..a76bf31 --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_3.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = ricorsione_3 +build_property.ProjectDir = /home/Verde/git/ricorsione_3/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/obj/Debug/net9.0/ricorsione_3.GlobalUsings.g.cs b/obj/Debug/net9.0/ricorsione_3.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_3.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/obj/Debug/net9.0/ricorsione_3.assets.cache b/obj/Debug/net9.0/ricorsione_3.assets.cache new file mode 100644 index 0000000..a92ee7b Binary files /dev/null and b/obj/Debug/net9.0/ricorsione_3.assets.cache differ diff --git a/obj/Debug/net9.0/ricorsione_3.csproj.CoreCompileInputs.cache b/obj/Debug/net9.0/ricorsione_3.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..e5663d5 --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_3.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +30d11ad3a794b532534c3c44168a423176afdd049644f6fb31571d362d6dbf5d diff --git a/obj/Debug/net9.0/ricorsione_3.csproj.FileListAbsolute.txt b/obj/Debug/net9.0/ricorsione_3.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..05917c1 --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_3.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/Verde/git/ricorsione_3/bin/Debug/net9.0/ricorsione_3 +/home/Verde/git/ricorsione_3/bin/Debug/net9.0/ricorsione_3.deps.json +/home/Verde/git/ricorsione_3/bin/Debug/net9.0/ricorsione_3.runtimeconfig.json +/home/Verde/git/ricorsione_3/bin/Debug/net9.0/ricorsione_3.dll +/home/Verde/git/ricorsione_3/bin/Debug/net9.0/ricorsione_3.pdb +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/ricorsione_3.GeneratedMSBuildEditorConfig.editorconfig +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/ricorsione_3.AssemblyInfoInputs.cache +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/ricorsione_3.AssemblyInfo.cs +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/ricorsione_3.csproj.CoreCompileInputs.cache +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/ricorsione_3.dll +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/refint/ricorsione_3.dll +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/ricorsione_3.pdb +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/ricorsione_3.genruntimeconfig.cache +/home/Verde/git/ricorsione_3/obj/Debug/net9.0/ref/ricorsione_3.dll diff --git a/obj/Debug/net9.0/ricorsione_3.dll b/obj/Debug/net9.0/ricorsione_3.dll new file mode 100644 index 0000000..501d1b5 Binary files /dev/null and b/obj/Debug/net9.0/ricorsione_3.dll differ diff --git a/obj/Debug/net9.0/ricorsione_3.genruntimeconfig.cache b/obj/Debug/net9.0/ricorsione_3.genruntimeconfig.cache new file mode 100644 index 0000000..f6d8b29 --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_3.genruntimeconfig.cache @@ -0,0 +1 @@ +805f93484c00ae750f8f359187dbc2451fcd3f763aab5229ab85ab145ad99007 diff --git a/obj/Debug/net9.0/ricorsione_3.pdb b/obj/Debug/net9.0/ricorsione_3.pdb new file mode 100644 index 0000000..64126e4 Binary files /dev/null and b/obj/Debug/net9.0/ricorsione_3.pdb differ