Countdown funziona, la media divide per un'unità in più

This commit is contained in:
La Programmatrice Verde 2024-11-08 10:25:18 +01:00
parent 44ba1d7a25
commit bdef1b6927
20 changed files with 126 additions and 1 deletions

View File

@ -4,6 +4,32 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
//dichiarazione e inizializzazione variabili
ulong num, i, j, media, somma;
j=1;
somma=0;
//input e input sanitization
do{
Console.Write("Inserire un numero per iniziare il conto alla rovescia: ");
num=Convert.ToUInt64(Console.ReadLine());
if(num<=0){
Console.WriteLine("Il numero non può essere né negativo né zero");
}
}
while(num<=0);
//stampa dei numeri
for(i=num;i>0;i--){
Console.WriteLine(i);
}
Console.WriteLine("Inserire una serie di numeri per calcolarne la media");
do{
Console.Write("Inserire un numero: ");
num=Convert.ToUInt64(Console.ReadLine());
somma=num+somma;
media=somma/j;
j++;
}
while(num!=0);
Console.WriteLine("La media è " +media);
}
}

Binary file not shown.

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"average_countdown/1.0.0": {
"runtime": {
"average_countdown.dll": {}
}
}
}
},
"libraries": {
"average_countdown/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("average_countdown")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+44ba1d7a25be57c3f172e92cbbf647316a61d8ea")]
[assembly: System.Reflection.AssemblyProductAttribute("average_countdown")]
[assembly: System.Reflection.AssemblyTitleAttribute("average_countdown")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generato dalla classe WriteCodeFragment di MSBuild.

View File

@ -0,0 +1 @@
0f1f48d471828a857a307e1f6289cc55aadb56e4416d02d6d1ea7a2c78e85530

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 = average_countdown
build_property.ProjectDir = /home/BrainTheBest5/git/average_countdown/
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;

Binary file not shown.

View File

@ -0,0 +1 @@
38a3f801050e8ec58c25e81cd0a4949581be2415831ea67d017ec1a7a7f261ab

View File

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

Binary file not shown.

View File

@ -0,0 +1 @@
efe262fd5394d85255b0dae0fd97a800777ca1b1dd51475a4d724ddd7815343e

Binary file not shown.

Binary file not shown.

Binary file not shown.