• написать программу выводящую числа в диапазоне от 100 до 1001 и посчитать их сумму в c#​

Ответы 1

  • using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text.RegularExpressions;

    namespace Rextester

    {

       public class Program

       {

           public static void Main(string[] args)

           {

               int sum = 0;

               

               for (int i = 100; i <= 1001; i++)

               {

                   Console.WriteLine(i);

                   sum += i;

               }

               Console.WriteLine("Sum = {0}", sum);

           }

       }

    }

    • Автор:

      dunce
    • 5 лет назад
    • 0
  • Добавить свой ответ

Еще вопросы

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years