blog.itcode.devblog.itcode.dev

[Baekjoon / JAVA] Baekjoon Algorithm 1000 A + B

Write a program that reads two integers A and B, then prints A + B.

[Baekjoon / JAVA] Baekjoon Algorithm 1000 A + B

Write a program that reads two integers A and B, then prints A + B.
RWB0104
@RWBwritten at 2021-05-21 12:38:17
Baekjoon Algorithm

시리즈 모아보기

Baekjoon Algorithm

1 / 22
RankLanguage Used

🖼️ JAVA

🔗 Full Problem 1000

Time LimitMemory Limit
2 sec128MB

Write a program that reads two integers A and B, then prints A + B.

The first line gives A and B. (0<A,B<10)(0 < A, B < 10)

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
ship
blog.itcode.dev

Notes from the π-th Alpaca

7.0.1
Developed by RWB since 2021.057th upgraded at 2026.08