Browse Source

solve problem 6

main
Colin McMillen 11 months ago
parent
commit
7d323062a4
  1. 12
      Program.cs

12
Program.cs

@ -110,8 +110,18 @@ namespace Euler {
}
}
static long Problem6() {
long sum = 0;
long sumSq = 0;
for (long i = 1; i <= 100; i++) {
sum += i;
sumSq += i * i;
}
return sum * sum - sumSq;
}
static void Main(string[] args) {
WriteLine(Problem5());
WriteLine(Problem6());
}
}
}
Loading…
Cancel
Save