File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # [ Bronze V] 문자열 - 9086
2+
3+ [ 문제 링크] ( https://www.acmicpc.net/problem/9086 )
4+
5+ ### 성능 요약
6+
7+ 메모리: 15916 KB, 시간: 144 ms
8+
9+ ### 분류
10+
11+ 구현, 문자열
12+
13+ ### 제출 일자
14+
15+ 2023년 2월 20일 22:58:52
16+
17+ ### 문제 설명
18+
19+ <p >문자열을 입력으로 주면 문자열의 첫 글자와 마지막 글자를 출력하는 프로그램을 작성하시오.</p >
20+
21+ ### 입력
22+
23+ <p >입력의 첫 줄에는 테스트 케이스의 개수 T(1 ≤ T ≤ 10)가 주어진다. 각 테스트 케이스는 한 줄에 하나의 문자열이 주어진다. 문자열은 알파벳 A~Z 대문자로 이루어지며 알파벳 사이에 공백은 없으며 문자열의 길이는 1000보다 작다.</p >
24+
25+ ### 출력
26+
27+ <p >각 테스트 케이스에 대해서 주어진 문자열의 첫 글자와 마지막 글자를 연속하여 출력한다.</p >
28+
Original file line number Diff line number Diff line change 1+ 3
2+ ACDKJFOWIEGHE
3+ O
4+ AB
Original file line number Diff line number Diff line change 1+ AE
2+ OO
3+ AB
Original file line number Diff line number Diff line change 1+
2+ import java .io .*;
3+ public class Main {
4+ public static void main (String [] args ) throws IOException {
5+
6+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
7+ int cnt = Integer .parseInt (br .readLine ());
8+ for (int i = 0 ; i <cnt ; i ++) {
9+ String s = br .readLine ();
10+
11+ System .out .println (s .charAt (0 )+"" +s .charAt (s .length ()-1 ));
12+ }
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments