CSharp · Console
using System;
public class Program
{
public static void Main()
{
int[] x= new int[10];
int Tot=0;
for (int i=0; i<10; i++)
{
if ((i%3==0)||(i%5==0))
{
x[i] = i;
// Console.WriteLine(x[i]);
Tot += x[i];
}
}
Console.WriteLine(Tot);
}
}