250x250
반응형
Notice
Recent Posts
Recent Comments
Link
N
(프로그래머스 c++)[PCCE 기출문제] 4번 / 병과분류 본문
728x90
반응형
https://school.programmers.co.kr/learn/courses/30/lessons/340204
프로그래머스
SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
빈칸을 채워서 푸는 문제.
각 조건에 따라 출력되는 값이 다르게 나온다.
출력되는 값을 보고 조건을 넣어주면 된다.
#include <iostream>
using namespace std;
int main(void) {
string code;
cin >> code;
string last_four_words = code.substr(code.size()-4, 4);
if(last_four_words == "_eye") { // 빈칸
cout << "Ophthalmologyc";
}
else if(last_four_words == "head") { // 빈칸
cout << "Neurosurgery";
}
else if(last_four_words == "infl"){ // 빈칸
cout << "Orthopedics";
}
else if (last_four_words == "skin") // 빈칸
{
cout << "Dermatology";
}
else // 빈칸
{
cout << "direct recommendation";
}
return 0;
}
728x90
반응형
'프로그래머스 알고리즘 > 0 & 1단계' 카테고리의 다른 글
(프로그래머스 C++)상자 꺼내기 (3) | 2025.07.27 |
---|---|
(프로그래머스 c++) [PCCE 기출문제] 5번 / 심폐소생술 (0) | 2025.07.26 |
[PCCE 기출문제] 3번 / 수 나누기 (0) | 2025.07.26 |
(프로그래머스 c++)[PCCE 기출문제] 2번 / 각도 합치기 (0) | 2025.07.26 |
(프로그래머스 c++) 이차원 배열 대각선 순회하기 (1) | 2025.07.24 |