Advertisement
veronikaaa86

02. Sum Big Numbers

Oct 27th, 2021
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. package objectAndClasses;
  2.  
  3. import java.math.BigInteger;
  4. import java.util.Scanner;
  5.  
  6. public class P02SumBigNumbers {
  7. public static void main(String[] args) {
  8. Scanner scanner = new Scanner(System.in);
  9.  
  10. BigInteger firstNum = new BigInteger(scanner.nextLine());
  11. BigInteger secondNum = new BigInteger(scanner.nextLine());
  12.  
  13. //100 + 4
  14.  
  15. BigInteger result = firstNum.add(secondNum);
  16.  
  17. System.out.println(result);
  18. }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement