class Solution {
public int solution(String[] order) {
int answer = 0;
return answer;
}
}
class Solution {
public int solution(String[] order) {
int answer = 0;
for (int i = 0; i < order.length; i++) {
if (order[i].equals("americano") || order[i].equals("iceamericano") || order[i].equals("americanoice") || order[i].equals("hotamericano") || order[i].equals("americanohot") || order[i].equals("anything")) {
answer += 4500;
} else if (order[i].equals("cafelatte") || order[i].equals("icecafelatte") || order[i].equals("cafelatteice") || order[i].equals("hotcafelatte") || order[i].equals("cafelattehot")) {
answer += 5000;
}
}
return answer;
}
}
가격
아메리카노 : 4500원
카페 라테 : 5000원
class Solution {
public int solution(String[] order) {
int answer = 0;
for (String a : order) {
if (a.contains("americano") || a.equals("anything")) {
answer += 4500;
} else {
answer += 5000;
}
return answer;
}
}
class Solution {
public int solution(String[] order) {
int answer = 0;
for (String a : order) {
if (a.contains("cafelatte")) {
answer += 5000;
} else {
answer += 4500;
}
}
return answer;
}
}