@@ -0,0 +1,1108 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.math.*;%0Aimport java.math.BigInteger;%0A%0A%0Apublic class Problem56%0A%7B%0A    public static void main(String arg%5B%5D)%0A    %7B%0A        // BigInteger maxSum = new BigInteger(%220%22);%0A        int maxSum = 0;%0A        BigInteger curSum = new BigInteger(%220%22);%0A        BigInteger one = new BigInteger(%221%22);%0A        BigInteger hundred = new BigInteger(%22100%22);%0A        for (BigInteger a = new BigInteger(%221%22); !a.equals(hundred); a = a.add(one))%0A        %7B%0A            for (int b = 1; b %3C 100; ++b)%0A            %7B%0A                curSum = a.pow(b);%0A                int tmp = digitSum(curSum); %0A                if (tmp %3E maxSum)%0A                %7B%0A                    maxSum = tmp;%0A                %7D%0A                // System.out.println(%22curSum %22 + curSum);%0A            %7D%0A        %7D%0A%0A        System.out.println(%22max digit sum : %22 + maxSum);%0A    %7D%0A    %0A    public static int digitSum(BigInteger n)%0A    %7B%0A        int ans = 0;%0A        String s = n.toString();%0A        for (int i = 0; i %3C s.length(); ++i)%0A        %7B%0A            ans += s.charAt(i) - '0';%0A        %7D%0A        return ans;%0A    %7D%0A%7D%0A

solve it using java BigInteger class, brute force,good