Osszegzo
unknown
csharp
2 years ago
564 B
12
Indexable
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
List<int> numbers = new List<int>();
int input;
int sum = 0;
while (true)
{
Console.Write("Adjon meg egy számot (0 a összegzéshez): ");
input = int.Parse(Console.ReadLine());
numbers.Add(input);
sum += input;
if (input == 0)
{
Console.WriteLine("Korábbi számok összege: " + sum);
break;
}
}
}
}
Editor is loading...