Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Binary Tree
- hash table
- Stack
- 구현
- 자바
- two pointers
- array
- 코테
- dynamic programming
- greedy
- simulation
- implement
- Data Structure
- 파이썬
- SQL
- string
- Binary Search
- 코딩테스트
- java
- Counting
- sorting
- bit manipulation
- Number Theory
- geometry
- Method
- Matrix
- Math
- Tree
- database
- Class
Archives
- Today
- Total
코린이의 소소한 공부노트
[백준 온라인 저지] 10869. 사칙연산 본문
- 입력: 두 자연수 A와 B가 주어진다. (1 ≤ A, B ≤ 10,000)
- 출력: 첫째 줄에 A+B, 둘째 줄에 A-B, 셋째 줄에 A*B, 넷째 줄에 A/B, 다섯째 줄에 A%B를 출력한다.
import java.util.*;
class Main{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int a = scan.nextInt(), b = scan.nextInt();
System.out.println(a + b);
System.out.println(a - b);
System.out.println(a * b);
System.out.println(a / b);
System.out.println(a % b);
}
}
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[백준 온라인 저지] 18108. 1998년생인 내가 태국에서는 2541년생?! (0) | 2023.03.17 |
---|---|
[백준 온라인 저지] 10926. ??! (0) | 2023.03.17 |
[백준 온라인 저지] 1008. A/B (0) | 2023.03.17 |
[백준 온라인 저지] 10998. A×B (0) | 2023.03.17 |
[백준 온라인 저지] 1001. A-B (0) | 2023.03.17 |