[Baekjoon / JAVA] Baekjoon Algorithm 1000 A + B
[Baekjoon / JAVA] Baekjoon Algorithm 1000 A + B
Write a program that reads two integers A and B, then prints A + B.
@RWBwritten at 2021-05-21 12:38:17
| Rank | Language Used |
|---|---|
🖼️ JAVA |
| Time Limit | Memory Limit |
|---|---|
| 2 sec | 128MB |
Write a program that reads two integers A and B, then prints A + B.
The first line gives A and B.
Print A + B on the first line.
- Input
TC
1 2
- Output
TC
3
This is a basic arithmetic operation, barely worthy of being called an algorithm. Read two numbers with Scanner, add them, and print the result.
JAVA
import java.util.Scanner; /** * Baekjoon Problem 1000 algorithm class * * @author RWB * @see <a href="https://blog.itcode.dev/posts/2021/05/21/a1000">1000 solution</a> * @since 2021.04.21 Wed 21:38:17 */ public class Main { /** * Main function * * @param args: [String[]] parameters */ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); scanner.close(); System.out.println(a + b); } }
- Math
- Implementation
- Arithmetic Operations
# Baekjoon# Algorithm# JAVA# Arithmetic Operations# BRONZE# BRONZE V
