반응형
https://www.acmicpc.net/problem/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
코드
#include <iostream>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = 0; i < str.size(); i++) {
str[i] = toupper(str[i]);
}
cout << str;
return 0;
}
풀이
알파벳 문자열을 입력받아 소문자는 대문자로 변환하여 출력하는 문제이다.
string형으로 문자열을 입력받은 뒤 toupper 함수를 사용하면 소문자를 대문자로 변활 할 수 있다.
반응형
'문제 해결 > BaekJoon' 카테고리의 다른 글
[백준] [C++] 17869번 Simple Collatz Sequence (0) | 2022.11.19 |
---|---|
[백준] [C++] 15700번 타일 채우기 4 (0) | 2022.11.19 |
[백준] [C++] 14681번 사분면 고르기 (0) | 2022.11.18 |
[백준] [C++] 14038번 Tournament Selection (0) | 2022.11.18 |
[백준] [C++] 13752번 히스토그램 (0) | 2022.11.18 |