The answer is a bit of a trick, and there is actually a hint within the question: Start your prime count at 2, not at 1, or 0, like me. using System; public class Seven { static void Main() { int a = 2; int b = 0; int c = 10001; while (b < [...]
using System; public class Six { static void Main() { double a = 100; double b = 0; double c = 0; for (int i = 1; i < = a; i++) { b += (i * i); c += i; } c = c * c; if (b > c) Console.WriteLine(“n{0}n”, b – c); [...]
using System; public class Five { static void Main() { int a = 20; int b = 0; while (b < = 0) { for (int i = 11; i < 20; i++) { if (a % i != 0) { a += 20; break; } else if (i == 19) { b = a; [...]
using System; public class Four { static void Main() { int a = 0; int b = -1; int c = 999; for (int i = 100; i < = c; i++) { for (int j = 100; j <= c; j++) { a = i * j; if ((a == Reverse(a)) && (a > [...]
using System; public class Three { static void Main() { long a = 600851475143; int b = Convert.ToInt32(Math.Sqrt(a)); int c = 0; for (int i = b; i >= 2; i–) { if (a % i == 0) if (ChkPrime(i)) { c = i; break; } } Console.WriteLine(“n{0}n”, c); } static bool ChkPrime(int c) { [...]
using System; public class Two { static void Main() { int a = 1; int b = 1; int c = 0; int sum = 0; int cap = 4000000; do { c = a + b; if (c % 2 == 0) sum += c; a = b; b = c; } while (c [...]
using System; public class One { static void Main() { int a = 0; int b = 1000; for (int i = 1; i < b; i++) { if ((i % 5 == 0) || (i % 3 ==0)) a += i; } Console.WriteLine(“\n{0}\n”, a); } }