- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
using System;
namespace Trening_6
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Введите 2 числа через пробел...");
string[] Value = Console.ReadLine().Split(new char[] {' '});
int Result = 0;
for (int i = Convert.ToInt32(Value[0]); i < Convert.ToInt32(Value[1]) + 1; i++)
{
Result += i;
}
Console.WriteLine("Сумма всех чисел в диапозоне от {0} до {1} равна {2}", Convert.ToInt32(Value[0]), Convert.ToInt32(Value[1]), Result);
Console.ReadKey();
}
}
}
> Ни я [...], ни я
Громотей!
Кстати, почему бы и нет, если формулами нельзя пользоваться.