https://www.acmicpc.net/problem/4458
4458번: 첫 글자를 대문자로
첫째 줄에 줄의 수 N이 주어진다. 다음 N개의 줄에는 문장이 주어진다. 각 문장에 들어있는 글자의 수는 30을 넘지 않는다. 모든 줄의 첫 번째 글자는 알파벳이다.
www.acmicpc.net
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
StringBuffer sb = new StringBuffer();
for (int i = 0; i < N; i++) {
String str = br.readLine();
sb.append(Character.toUpperCase(str.charAt(0)) + str.substring(1)).append("\n");
}
sb.setLength(sb.length() - 1);
System.out.println(sb);
}
}
'알고리즘 > 백준' 카테고리의 다른 글
백준 1598 꼬리를 무는 숫자 나열 (0) | 2022.12.08 |
---|---|
백준 5988 홀수일까 짝수일까 (0) | 2022.12.07 |
백준 10178 할로윈의 사탕 (0) | 2022.12.07 |
백준 11966 2의 제곱인가 (0) | 2022.12.07 |
백준 11023 더하기 3 (0) | 2022.12.07 |