Java Big Integer Hacker rank
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class Solution {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String a=sc.next();
String b=sc.next();
BigInteger b1=new BigInteger(a);
BigInteger b2=new BigInteger(b);
BigInteger c,d;
c=b1.add(b2);
d=b1.multiply(b2);
System.out.println(c);
System.out.println(d);
}
}
Comments
Post a Comment