https://www.hackerrank.com/challenges/java-biginteger/problem?isFullScreen=true
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
BigInteger a = new BigInteger(sc.nextLine());
BigInteger b = new BigInteger(sc.nextLine());
System.out.println(a.add(b));
System.out.println(a.multiply(b));
}
}
반응형
'HackerRank > JAVA' 카테고리의 다른 글
Java 1D Array (1) | 2024.01.22 |
---|---|
Java Exception Handling (Try-catch) (0) | 2024.01.22 |
Java Primality Test (0) | 2024.01.22 |
Valid Username Regular Expression (0) | 2024.01.19 |
[작성중]Java Regex 2 - Duplicate Words (0) | 2024.01.19 |