public static void Main() { WriteLine("Problem 48"); string answer = Problem48.Solve(); WriteLine($"lastTenDigits = {answer}"); // 9110846700 }
void addpow(int num, int exp) { Problem48 temp = new Problem48(1); for (int i = 0; i < exp; i++ ) { temp.mult(num); } this.add(temp.bignum); }
static void Main(string[] args) { Problem48 prog = new Problem48(); for (int i = 1; i <= 1000; i++) { prog.addpow(i, i); } Console.Write("Answer = "); for (int i = prog.max_index - 4991; i >= 0; i--) { Console.Write(prog.bignum[i]); } Console.WriteLine(); Console.ReadKey(); }