Project Euler Solutions - lumikun/projecteuler GitHub Wiki
Solution 1.
int ans = 0;
for (int i = 0; i < 1000; i++ )
ans += i % 3 == 0 || i % 5 == 0 ? i : 0;
int ans = 0;
for (int i = 0; i < 1000; i++ )
ans += i % 3 == 0 || i % 5 == 0 ? i : 0;