Skip to content

Commit 0214df1

Browse files
committed
[level 0] Title: 대문자로 바꾸기, Time: 0.01 ms, Memory: 4.21 MB -BaekjoonHub
1 parent b1bac97 commit 0214df1

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# [level 0] 대문자로 바꾸기 - 181877
2+
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/181877)
4+
5+
### 성능 요약
6+
7+
메모리: 4.21 MB, 시간: 0.01 ms
8+
9+
### 구분
10+
11+
코딩테스트 연습 > 코딩 기초 트레이닝
12+
13+
### 채점결과
14+
15+
정확성: 100.0<br/>합계: 100.0 / 100.0
16+
17+
### 제출 일자
18+
19+
2026년 03월 18일 17:47:04
20+
21+
### 문제 설명
22+
23+
<p>알파벳으로 이루어진 문자열 <code>myString</code>이 주어집니다. 모든 알파벳을 대문자로 변환하여 return 하는 solution 함수를 완성해 주세요.</p>
24+
25+
<hr>
26+
27+
<h5>제한사항</h5>
28+
29+
<ul>
30+
<li>1 ≤ <code>myString</code>의 길이 ≤ 100,000
31+
32+
<ul>
33+
<li><code>myString</code>은 알파벳으로 이루어진 문자열입니다.</li>
34+
</ul></li>
35+
</ul>
36+
37+
<hr>
38+
39+
<h5>입출력 예</h5>
40+
<table class="table">
41+
<thead><tr>
42+
<th>myString</th>
43+
<th>result</th>
44+
</tr>
45+
</thead>
46+
<tbody><tr>
47+
<td>"aBcDeFg"</td>
48+
<td>"ABCDEFG"</td>
49+
</tr>
50+
<tr>
51+
<td>"AAA"</td>
52+
<td>"AAA"</td>
53+
</tr>
54+
</tbody>
55+
</table>
56+
57+
> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <string>
2+
#include <vector>
3+
4+
using namespace std;
5+
6+
string solution(string myString) {
7+
string answer = "";
8+
for(char c : myString){
9+
if(c >= 'a' && c <= 'z'){
10+
answer += (c-32);
11+
}
12+
else answer += c;
13+
}
14+
return answer;
15+
}

0 commit comments

Comments
 (0)