Completato

This commit is contained in:
La Programmatrice Verde 2025-04-03 20:16:58 +02:00
parent 6f92c18a0f
commit 5a3e8e3b66
20 changed files with 133 additions and 5 deletions

View File

@ -1,9 +1,36 @@
namespace ricorsione_3; namespace ricorsione_3;
class Program class Program {
{ static void Main(string[] args) {
static void Main(string[] args) Console.Write("Quanti numeri inserire? ");
{ int[] array = new int[Convert.ToInt32(Console.ReadLine())];
Console.WriteLine("Hello, World!");
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);
}
}

BIN
bin/Debug/net9.0/ricorsione_3 Executable file

Binary file not shown.

View File

@ -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": ""
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net9.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "9.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]

BIN
obj/Debug/net9.0/apphost Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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.

View File

@ -0,0 +1 @@
6ee7a83a7bf5bd63fb208ec7bf35df7b72cd982e16fc27673f70de4813181932

View File

@ -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 =

View File

@ -0,0 +1,8 @@
// <auto-generated/>
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;

Binary file not shown.

View File

@ -0,0 +1 @@
30d11ad3a794b532534c3c44168a423176afdd049644f6fb31571d362d6dbf5d

View File

@ -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

Binary file not shown.

View File

@ -0,0 +1 @@
805f93484c00ae750f8f359187dbc2451fcd3f763aab5229ab85ab145ad99007

Binary file not shown.