[Unrated] CAPS - 15000
15000번: CAPS
Earth is under attack! Messages need to be sent to the Earth Defense Force (EDF) that makes clear that the situation is dire. The EDF’s strongest forces consist of mechs (huge bipedal robots) that are piloted by Japanese teenagers. To make sure that the
www.acmicpc.net
성능 요약
메모리: 31256 KB, 시간: 520 ms
분류
구현, 문자열
문제 설명
Earth is under attack! Messages need to be sent to the Earth Defense Force (EDF) that makes clear that the situation is dire. The EDF’s strongest forces consist of mechs (huge bipedal robots) that are piloted by Japanese teenagers. To make sure that the messages come across as urgent, they must be displayed on the monitors of the pilots in uppercase letters. Unfortunately, the tachyon communication system that is used by the EDF is only able to send strings in lower-case alphabetic characters.
The set of lower-case alphabetic characters is made up of the following characters: ’a’, ’b’, ’c’, ’d’, ’e’, ’f’, ’g’, ’h’, ’i’, ’j’, ’k’, ’l’, ’m’, ’n’, ’o’, ’p’, ’q’, ’r’, ’s’, ’t’, ’u’, ’v’, ’w’, ’x’, ’y’, ’z’.
Your job is to write a program that converts the given messages to upper-case.
입력
- A single line containing a string of length n (100 ≤ n ≤ 106), consisting of lower-case alphabetic characters.
출력
- A single line containing the input string where all letters are converted to upper-case letters.
답 : toUpperCase 를 통해 소문자로 변환한다.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String input = sc.nextLine(); // 소문자를 입력 받음
String output = input.toUpperCase(); // 입력받은 소문자를 대문자로 변환
System.out.println(output);
sc.close();
}
}
'algorithm > 백준' 카테고리의 다른 글
[백준] SASA 모형을 만들어보자 -23825 Java[자바] (0) | 2023.03.27 |
---|---|
[백준] Dedupe - 5357 Java[자바] (0) | 2023.03.26 |
[백준] 사장님 도박은 재미로 하셔야 합니다 - 23795 Java[자바] (0) | 2023.03.24 |
[백준] 공백 없는 A+B - 15873 Java[자바] (0) | 2023.03.23 |
[백준] 등장하지 않는 문자의 합 - 3059 Java[자바] (0) | 2023.03.22 |