UVA424:

Integer Inquiry

import java.util.*;
import java.math.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		BigInteger sum = new BigInteger("0");
		while(sc.hasNext()){

			String in = sc.nextLine();
			BigInteger temp = new BigInteger(in);

			sum = sum.add(temp);

			if(in.equals("0")){
				System.out.println(sum);
				break;
			}


		}

	}

}

[Back to Listing Page]

Home

Posts

Projects

Github

Contact

janzzen

Developed by Janzzen Ang powered by Vercel