Didart

Sum Big Numbers

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