You are viewing a single comment's thread. Return to all comments →
java
import java.io.; import java.util.; import java.lang.Object; import java.lang.Number; import java.math.BigInteger; public class Solution {
public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); BigInteger sum= BigInteger.valueOf(0); for(int i=0;i<n;i++) { BigInteger num=sc.nextBigInteger(); sum=sum.add(num); } char ch[]=sum.toString().toCharArray(); for(int i=0;i<10;i++) { System.out.print(ch[i]); } }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #13: Large sum
You are viewing a single comment's thread. Return to all comments →
java
import java.io.; import java.util.; import java.lang.Object; import java.lang.Number; import java.math.BigInteger; public class Solution {
}