Skip to content

Instantly share code, notes, and snippets.

@Kanol
Created March 6, 2015 10:52
Show Gist options
  • Save Kanol/e911365905d388fbcf4f to your computer and use it in GitHub Desktop.
Save Kanol/e911365905d388fbcf4f to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Сумма_N_чисел
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите количество чисел");
Int32 Number = Convert.ToInt32(Console.ReadLine()), Number2, Number3 = 0;
while (Number != 0)
{
Console.Write("Осталось ");
Console.WriteLine(Number);
Number2 = Convert.ToInt32(Console.ReadLine());
Number3 = Number3 + Number2;
Number = Number - 1;
}
Console.Write("Сумма чисел равна ");
Console.Write(Number3);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment