Advertisement
veronikaaa86

02. Sum Big Numbers

Feb 22nd, 2023
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 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.         BigInteger sum = firstNum.add(secondNum);
  14.  
  15.         System.out.println(sum);
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement