diff --git a/Program.cs b/Program.cs index 40337fe..0830313 100644 --- a/Program.cs +++ b/Program.cs @@ -1,9 +1,28 @@ namespace ricorsione_2; -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello, World!"); +class Program { + static void Main(string[] args) { + Console.Write("Inserire un numero: "); + Console.WriteLine(Ricorsione(Convert.ToInt32(Console.ReadLine()))); + } + + static int Ricorsione(int p_numero1) { //aggiungi uno a p_numero1 p_numero2 volte + int temp, ritorno = 0; + if (p_numero1 > 10) { + //somma le cifre del numero + while (p_numero1 > 0) { + temp = p_numero1 % 10; //ultima cifra + p_numero1 = p_numero1 / 10; //rimuovo l'ultima cifra dal numero + ritorno = ritorno + temp; + } + ritorno = Ricorsione(ritorno); + + } + else { + ritorno = p_numero1; + } + + return ritorno; } } + diff --git a/bin/Debug/net9.0/ricorsione_2 b/bin/Debug/net9.0/ricorsione_2 new file mode 100755 index 0000000..22e2041 Binary files /dev/null and b/bin/Debug/net9.0/ricorsione_2 differ diff --git a/bin/Debug/net9.0/ricorsione_2.deps.json b/bin/Debug/net9.0/ricorsione_2.deps.json new file mode 100644 index 0000000..b900853 --- /dev/null +++ b/bin/Debug/net9.0/ricorsione_2.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "ricorsione_2/1.0.0": { + "runtime": { + "ricorsione_2.dll": {} + } + } + } + }, + "libraries": { + "ricorsione_2/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/bin/Debug/net9.0/ricorsione_2.dll b/bin/Debug/net9.0/ricorsione_2.dll new file mode 100644 index 0000000..ceee604 Binary files /dev/null and b/bin/Debug/net9.0/ricorsione_2.dll differ diff --git a/bin/Debug/net9.0/ricorsione_2.pdb b/bin/Debug/net9.0/ricorsione_2.pdb new file mode 100644 index 0000000..bfa5680 Binary files /dev/null and b/bin/Debug/net9.0/ricorsione_2.pdb differ diff --git a/bin/Debug/net9.0/ricorsione_2.runtimeconfig.json b/bin/Debug/net9.0/ricorsione_2.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/bin/Debug/net9.0/ricorsione_2.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..22e2041 Binary files /dev/null and b/obj/Debug/net9.0/apphost differ diff --git a/obj/Debug/net9.0/ref/ricorsione_2.dll b/obj/Debug/net9.0/ref/ricorsione_2.dll new file mode 100644 index 0000000..e0467e3 Binary files /dev/null and b/obj/Debug/net9.0/ref/ricorsione_2.dll differ diff --git a/obj/Debug/net9.0/refint/ricorsione_2.dll b/obj/Debug/net9.0/refint/ricorsione_2.dll new file mode 100644 index 0000000..e0467e3 Binary files /dev/null and b/obj/Debug/net9.0/refint/ricorsione_2.dll differ diff --git a/obj/Debug/net9.0/ricorsione_2.AssemblyInfo.cs b/obj/Debug/net9.0/ricorsione_2.AssemblyInfo.cs new file mode 100644 index 0000000..fd570bf --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_2.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_2")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7093ef3e992f18c908438f22a5152197c48b0621")] +[assembly: System.Reflection.AssemblyProductAttribute("ricorsione_2")] +[assembly: System.Reflection.AssemblyTitleAttribute("ricorsione_2")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/obj/Debug/net9.0/ricorsione_2.AssemblyInfoInputs.cache b/obj/Debug/net9.0/ricorsione_2.AssemblyInfoInputs.cache new file mode 100644 index 0000000..4cce45d --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_2.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +c6ecc8a16734995aaa5a5e38355e2e60006a2930aa54237d6f81e3f6eb05cfdb diff --git a/obj/Debug/net9.0/ricorsione_2.GeneratedMSBuildEditorConfig.editorconfig b/obj/Debug/net9.0/ricorsione_2.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..2179dbf --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_2.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_2 +build_property.ProjectDir = /home/Verde/git/ricorsione_2/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/obj/Debug/net9.0/ricorsione_2.GlobalUsings.g.cs b/obj/Debug/net9.0/ricorsione_2.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_2.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_2.assets.cache b/obj/Debug/net9.0/ricorsione_2.assets.cache new file mode 100644 index 0000000..2582249 Binary files /dev/null and b/obj/Debug/net9.0/ricorsione_2.assets.cache differ diff --git a/obj/Debug/net9.0/ricorsione_2.csproj.CoreCompileInputs.cache b/obj/Debug/net9.0/ricorsione_2.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..c68d64e --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_2.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +09bcf0fc48665f90f3e471ee6d026762b69b6704f94718ee7a429b5363e145a3 diff --git a/obj/Debug/net9.0/ricorsione_2.csproj.FileListAbsolute.txt b/obj/Debug/net9.0/ricorsione_2.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..8d3b901 --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_2.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/Verde/git/ricorsione_2/bin/Debug/net9.0/ricorsione_2 +/home/Verde/git/ricorsione_2/bin/Debug/net9.0/ricorsione_2.deps.json +/home/Verde/git/ricorsione_2/bin/Debug/net9.0/ricorsione_2.runtimeconfig.json +/home/Verde/git/ricorsione_2/bin/Debug/net9.0/ricorsione_2.dll +/home/Verde/git/ricorsione_2/bin/Debug/net9.0/ricorsione_2.pdb +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/ricorsione_2.GeneratedMSBuildEditorConfig.editorconfig +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/ricorsione_2.AssemblyInfoInputs.cache +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/ricorsione_2.AssemblyInfo.cs +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/ricorsione_2.csproj.CoreCompileInputs.cache +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/ricorsione_2.dll +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/refint/ricorsione_2.dll +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/ricorsione_2.pdb +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/ricorsione_2.genruntimeconfig.cache +/home/Verde/git/ricorsione_2/obj/Debug/net9.0/ref/ricorsione_2.dll diff --git a/obj/Debug/net9.0/ricorsione_2.dll b/obj/Debug/net9.0/ricorsione_2.dll new file mode 100644 index 0000000..ceee604 Binary files /dev/null and b/obj/Debug/net9.0/ricorsione_2.dll differ diff --git a/obj/Debug/net9.0/ricorsione_2.genruntimeconfig.cache b/obj/Debug/net9.0/ricorsione_2.genruntimeconfig.cache new file mode 100644 index 0000000..d525cde --- /dev/null +++ b/obj/Debug/net9.0/ricorsione_2.genruntimeconfig.cache @@ -0,0 +1 @@ +b2809d35c2fba8c10e830b025ebf2346c418c6784f431a6da4a120ea79fc8a56 diff --git a/obj/Debug/net9.0/ricorsione_2.pdb b/obj/Debug/net9.0/ricorsione_2.pdb new file mode 100644 index 0000000..bfa5680 Binary files /dev/null and b/obj/Debug/net9.0/ricorsione_2.pdb differ