challenges/e1/e1.cs

14 lines
201 B
C#

using System;
public class E1
{
public static void Main() {
int sum = 0;
for(int i = 2; i < 1000; i++) {
if (i % 3 == 0 || i % 5 == 0)
sum += i;
}
System.Console.WriteLine(sum);
}
}