import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
BigInteger sum=BigInteger.ZERO;
while(true) {
String str=br.readLine();
BigInteger x=new BigInteger(str);
if(x.compareTo(BigInteger.ZERO)==0)
break;
sum=sum.add(x);
}
System.out.println(sum);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
BigInteger sum=BigInteger.ZERO;
while(true) {
String str=br.readLine();
BigInteger x=new BigInteger(str);
if(x.compareTo(BigInteger.ZERO)==0)
break;
sum=sum.add(x);
}
System.out.println(sum);
}
}
No comments:
Post a Comment