문제풀이: 사실 answer 하나로 가능하다
#include <string>
#include <vector>
using namespace std;
int solution(vector<int> box, int n) {
int answer = 0;
int x,y,z =0;
x = box[0]/n;
y = box[1]/n;
z = box[2]/n;
answer = x * y * z;
return answer;
}
'코딩테스트' 카테고리의 다른 글
프로그래머스_0단계_가장 큰 수 찾기C++ (0) | 2024.04.11 |
---|---|
프로그래머스_0단계_최댓값 만들기(2)C++ (0) | 2024.04.11 |
프로그래머스_0단계_개미군단C++ (0) | 2024.04.11 |
프로그래머스_2단계_멀리 뛰기C++ (0) | 2024.04.09 |
프로그래머스_2단계_피보나치 수C++ (0) | 2024.04.09 |