Level 0. 커피 심부름
카페라떼가 아니면 무조건 아메리카노이다.
#include <iostream>
#include <vector>
using namespace std;
int solution(vector<string> order)
{
int answer = 0;
for (string& s : order)
if (s.find("cafelatte") != string::npos)
answer += 5000;
else
answer += 4500;
return answer;
}
'자료구조 & 알고리즘 > 프로그래머스' 카테고리의 다른 글
Level 0. 배열 만들기 2 (0) | 2023.05.12 |
---|---|
Level 2. [1차] 뉴스 클러스터링 (0) | 2023.05.11 |
Level 0. 코드 처리하기 (0) | 2023.05.09 |
Level 2. [1차] 프렌즈4블록 (0) | 2023.05.08 |
Level 2. 삼각 달팽이 (0) | 2023.05.07 |