Programma copiato dal penultimo commit di fattoriale_moltiplicazione

This commit is contained in:
La Programmatrice Verde 2024-11-06 20:03:02 +01:00
parent 4cc1d720cd
commit a6001b4801
20 changed files with 131 additions and 1 deletions

View File

@ -4,6 +4,37 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
//dichiarazione variabili
int i, num;
ulong fattoriale;
//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==0){
fattoriale=1;
}
else{
fattoriale=Convert.ToUInt64(num);
//ciclo calcolo fattoriale
for(i=num-1; i>1; i--){
//calcolo fattoriale
fattoriale=fattoriale*Convert.ToUInt64(i);
}
}
//output finale
Console.Write("Il fattoriale di " +num);
Console.WriteLine(" è " +fattoriale);
}
}

Binary file not shown.

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"fattoriale_moltiplicazione_for/1.0.0": {
"runtime": {
"fattoriale_moltiplicazione_for.dll": {}
}
}
}
},
"libraries": {
"fattoriale_moltiplicazione_for/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.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=v8.0", FrameworkDisplayName = ".NET 8.0")]

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

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("fattoriale_moltiplicazione_for")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4cc1d720cd28130b6d97cfe838eb75939e424bc0")]
[assembly: System.Reflection.AssemblyProductAttribute("fattoriale_moltiplicazione_for")]
[assembly: System.Reflection.AssemblyTitleAttribute("fattoriale_moltiplicazione_for")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generato dalla classe WriteCodeFragment di MSBuild.

View File

@ -0,0 +1 @@
33cd92539e385a23f00d90d715c858971b2c263d5f91c0cb2c350af27554b2bf

View File

@ -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_moltiplicazione_for
build_property.ProjectDir = /home/BrainTheBest5/git/fattoriale_moltiplicazione_for/
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

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;

View File

@ -0,0 +1 @@
a12aa68342701f2e78c1289770f21e48c1c728a520aeadc8ea6745702f662f07

View File

@ -0,0 +1,14 @@
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/bin/Debug/net8.0/fattoriale_moltiplicazione_for
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/bin/Debug/net8.0/fattoriale_moltiplicazione_for.deps.json
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/bin/Debug/net8.0/fattoriale_moltiplicazione_for.runtimeconfig.json
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/bin/Debug/net8.0/fattoriale_moltiplicazione_for.dll
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/bin/Debug/net8.0/fattoriale_moltiplicazione_for.pdb
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/fattoriale_moltiplicazione_for.GeneratedMSBuildEditorConfig.editorconfig
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/fattoriale_moltiplicazione_for.AssemblyInfoInputs.cache
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/fattoriale_moltiplicazione_for.AssemblyInfo.cs
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/fattoriale_moltiplicazione_for.csproj.CoreCompileInputs.cache
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/fattoriale_moltiplicazione_for.dll
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/refint/fattoriale_moltiplicazione_for.dll
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/fattoriale_moltiplicazione_for.pdb
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/fattoriale_moltiplicazione_for.genruntimeconfig.cache
/home/BrainTheBest5/git/fattoriale_moltiplicazione_for/obj/Debug/net8.0/ref/fattoriale_moltiplicazione_for.dll

Binary file not shown.

View File

@ -0,0 +1 @@
5ed99a2d9d97a1c3548cbcfe7f65d0030145a14c0ba5726751e7f5e742f0471d

Binary file not shown.