namespace ConsoleApplication9 { class Program { static void Main() { Console.Write("N = "); int N = int.Parse(Console.ReadLine()); int Sum = 0; for (int i = 1; i <= N; ++i) if (i % 2 == 0) Sum += i; Console.WriteLine("Sum = {0}", Sum); Console.ReadKey(); } } }
namespace ConsoleApplication9
{
class Program
{
static void Main()
{
Console.Write("N = ");
int N = int.Parse(Console.ReadLine());
int Sum = 0;
for (int i = 1; i <= N; ++i)
if (i % 2 == 0) Sum += i;
Console.WriteLine("Sum = {0}", Sum);
Console.ReadKey();
}
}
}