Created
March 6, 2015 10:52
-
-
Save Kanol/e911365905d388fbcf4f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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