TOPIC
Runtime error C#
gcorrea20 asked 3 years ago
using System;
class URI {
static void Main(string[] args)
{
int x = Convert.ToInt32(Console.ReadLine());
int n = Convert.ToInt32(Console.ReadLine());
int soma, x2 = x;
while (n < 0 || n == 0)
{
n = Convert.ToInt32(Console.ReadLine());
}
for(int i = 0; i <= n-1; i++)
{
x2 += i;
}
soma = x + x2;
Console.WriteLine(soma);
}
}