https://school.programmers.co.kr/learn/courses/30/lessons/120845
각길이를 n으로 나눈 값을 전부 곱해주면된다.
#include <string>
#include <vector>
using namespace std;
int solution(vector<int> box, int n) {
int answer = 0;
answer = (box[0]/n)*(box[1]/n)*(box[2]/n);
return answer;
}
#include <string>
#include <vector>
using namespace std;
int solution(vector<int> box, int n) {
return (box[0] / n) * (box[1] / n) * (box[2] / n);
}
리턴을 바로 해준다.