일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 프로그래머스
- 깊이우선탐색
- java
- 코테
- springboot
- select
- 알고리즘
- 데이터베이스
- 정렬
- BFS
- 우선순위큐
- mybatis
- 백준
- Effective Java
- Greedy
- DFS
- 그리디알고리즘
- join
- db
- 다이나믹프로그래밍
- 이펙티브자바
- mariaDB
- 피보나치
- Database
- IntelliJ
- SQL
- Spring
- DP
- 너비우선탐색
- 탐욕법
Archives
- Today
- Total
땀두 블로그
[백준] 11021번 - A+B-7 본문

단순 연산 문제이다. 타입캐스팅만 잘 해주면 쉽게 해결할 수 있다.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class p11021 {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int a = Integer.parseInt(br.readLine());
for (int i = 0; i < a; i++) {
StringTokenizer st = new StringTokenizer(br.readLine());
sb.append("Case #" + (int) (i + 1) + ": " + (int)(Integer.parseInt(st.nextToken()) + Integer.parseInt(st.nextToken())) + "\n");
}
System.out.println(sb);
}
}
'알고리즘 > 백준' 카테고리의 다른 글
[백준] 1389번 - 케빈 베이컨의 6단계 법칙 (0) | 2022.03.22 |
---|---|
[백준] 11022번 - A+B-8 (0) | 2022.03.22 |
[백준] 15552번 - 빠른 A+B (0) | 2022.03.22 |
[백준] 11047번 - 동전 0 (0) | 2022.03.22 |
[백준] 2178번 - 미로 탐색 (0) | 2022.03.22 |
Comments