목록Problem Solving/Programmers (10)
새발블로그
문제 https://school.programmers.co.kr/learn/courses/30/lessons/181949 풀이방법 char& 는 참초(reference) 타입을 나타냄 isupper : 대문자인지 판별 islower : 소문자인지 판별 toupper : 소문자 -> 대문자 tolower: 대문자 -> 소문자 풀이 #include #include using namespace std; int main(void) { string str; cin >> str; for (char& c : str) { if (isupper(c)) { c = tolower(c); } else if (islower(c)) { c = toupper(c); } } cout
문제 https://school.programmers.co.kr/learn/courses/30/lessons/181939 풀이방법 int -> string : to_string string -> int : stoi 풀이 #include #include using namespace std; int solution(int a, int b) { int answer = 0; string numA = to_string(a); string numB = to_string(b); string result1 = numA+numB; string result2 = numB+numA; if (result1 >=result2) { answer = stoi(result1); } else { answer = stoi(result2..