Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigInteger;
- import java.util.Scanner;
- public class Main {
- public static void main(String [] args)
- {
- BigInteger bi,sum,a;
- Scanner sc = new Scanner(System.in);
- sum = BigInteger.ZERO;
- a = BigInteger.ZERO;
- while(sc.hasNext())
- {
- bi = sc.nextBigInteger();
- if(bi.equals(a) )
- {
- break;
- }
- sum = sum.add(bi);
- }
- System.out.println(sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment