Non va nulla e non ho idea del motivo
This commit is contained in:
parent
0069d3f078
commit
c5af8bee6a
41
Program.cs
41
Program.cs
@ -4,6 +4,45 @@ class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello, World!");
|
||||
//dichiarazione e inizializzazione variabili
|
||||
int i, j, num;
|
||||
ulong fattoriale, fattorialePrec, fattorialeSupporto;
|
||||
//inizio programma
|
||||
//input e input sanitization
|
||||
do{
|
||||
Console.Write("Inserire un numero: ");
|
||||
num=Convert.ToInt32(Console.ReadLine());
|
||||
if(num<0){
|
||||
Console.WriteLine("Il numero non può essere negativo");
|
||||
}
|
||||
else if(num>65){
|
||||
Console.WriteLine("Il numero inserito è troppo grande");
|
||||
}
|
||||
}
|
||||
while(num<0 || num>65);
|
||||
//gestione caso 0
|
||||
if (num<=1){
|
||||
fattoriale=1;
|
||||
}
|
||||
else{
|
||||
fattoriale=Convert.ToUInt64(num);
|
||||
//ciclo calcolo fattoriale
|
||||
Console.WriteLine(fattoriale);
|
||||
for(i=1; i>num-1; i--){
|
||||
//calcolo fattoriale
|
||||
Console.WriteLine(fattoriale);
|
||||
Console.WriteLine(i);
|
||||
fattorialeSupporto=fattoriale;
|
||||
for(j=i; j>0; j--){
|
||||
fattorialePrec=fattoriale;
|
||||
fattoriale=fattorialeSupporto+fattorialePrec;
|
||||
Console.WriteLine(fattoriale);
|
||||
}
|
||||
//fattoriale=fattoriale*Convert.ToUInt64(i);
|
||||
}
|
||||
}
|
||||
//output finale
|
||||
Console.Write("Il fattoriale di " +num);
|
||||
Console.WriteLine(" è " +fattoriale);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
bin/Debug/net8.0/fattoriale_somma
Executable file
BIN
bin/Debug/net8.0/fattoriale_somma
Executable file
Binary file not shown.
23
bin/Debug/net8.0/fattoriale_somma.deps.json
Normal file
23
bin/Debug/net8.0/fattoriale_somma.deps.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"fattoriale_somma/1.0.0": {
|
||||
"runtime": {
|
||||
"fattoriale_somma.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"fattoriale_somma/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
bin/Debug/net8.0/fattoriale_somma.dll
Normal file
BIN
bin/Debug/net8.0/fattoriale_somma.dll
Normal file
Binary file not shown.
BIN
bin/Debug/net8.0/fattoriale_somma.pdb
Normal file
BIN
bin/Debug/net8.0/fattoriale_somma.pdb
Normal file
Binary file not shown.
12
bin/Debug/net8.0/fattoriale_somma.runtimeconfig.json
Normal file
12
bin/Debug/net8.0/fattoriale_somma.runtimeconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||
BIN
obj/Debug/net8.0/apphost
Executable file
BIN
obj/Debug/net8.0/apphost
Executable file
Binary file not shown.
22
obj/Debug/net8.0/fattoriale_somma.AssemblyInfo.cs
Normal file
22
obj/Debug/net8.0/fattoriale_somma.AssemblyInfo.cs
Normal 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("fattoriale_somma")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0069d3f078cae82f4b7d5655a3a2fc1e33fffd20")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("fattoriale_somma")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("fattoriale_somma")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Generato dalla classe WriteCodeFragment di MSBuild.
|
||||
|
||||
@ -0,0 +1 @@
|
||||
cfb584da00f8687aea9ca76bb315194fb261d639221e676583a64cade696674d
|
||||
@ -0,0 +1,13 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net8.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 = fattoriale_somma
|
||||
build_property.ProjectDir = /home/BrainTheBest5/git/fattoriale_somma/
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
8
obj/Debug/net8.0/fattoriale_somma.GlobalUsings.g.cs
Normal file
8
obj/Debug/net8.0/fattoriale_somma.GlobalUsings.g.cs
Normal 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;
|
||||
BIN
obj/Debug/net8.0/fattoriale_somma.assets.cache
Normal file
BIN
obj/Debug/net8.0/fattoriale_somma.assets.cache
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
6c9c825c2579b5c9df4d007cf9d08d59cd8450d1aa17137a0ad456c34e3bc6b7
|
||||
@ -0,0 +1,14 @@
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/fattoriale_somma.GeneratedMSBuildEditorConfig.editorconfig
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/fattoriale_somma.AssemblyInfoInputs.cache
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/fattoriale_somma.AssemblyInfo.cs
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/fattoriale_somma.csproj.CoreCompileInputs.cache
|
||||
/home/BrainTheBest5/git/fattoriale_somma/bin/Debug/net8.0/fattoriale_somma
|
||||
/home/BrainTheBest5/git/fattoriale_somma/bin/Debug/net8.0/fattoriale_somma.deps.json
|
||||
/home/BrainTheBest5/git/fattoriale_somma/bin/Debug/net8.0/fattoriale_somma.runtimeconfig.json
|
||||
/home/BrainTheBest5/git/fattoriale_somma/bin/Debug/net8.0/fattoriale_somma.dll
|
||||
/home/BrainTheBest5/git/fattoriale_somma/bin/Debug/net8.0/fattoriale_somma.pdb
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/fattoriale_somma.dll
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/refint/fattoriale_somma.dll
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/fattoriale_somma.pdb
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/fattoriale_somma.genruntimeconfig.cache
|
||||
/home/BrainTheBest5/git/fattoriale_somma/obj/Debug/net8.0/ref/fattoriale_somma.dll
|
||||
BIN
obj/Debug/net8.0/fattoriale_somma.dll
Normal file
BIN
obj/Debug/net8.0/fattoriale_somma.dll
Normal file
Binary file not shown.
1
obj/Debug/net8.0/fattoriale_somma.genruntimeconfig.cache
Normal file
1
obj/Debug/net8.0/fattoriale_somma.genruntimeconfig.cache
Normal file
@ -0,0 +1 @@
|
||||
b2e42e65b493d224fbf3d95564104146baed607c1041aa8f221a66c4ccb3d6d1
|
||||
BIN
obj/Debug/net8.0/fattoriale_somma.pdb
Normal file
BIN
obj/Debug/net8.0/fattoriale_somma.pdb
Normal file
Binary file not shown.
BIN
obj/Debug/net8.0/ref/fattoriale_somma.dll
Normal file
BIN
obj/Debug/net8.0/ref/fattoriale_somma.dll
Normal file
Binary file not shown.
BIN
obj/Debug/net8.0/refint/fattoriale_somma.dll
Normal file
BIN
obj/Debug/net8.0/refint/fattoriale_somma.dll
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user