강의로 돌아가기

### 뭐가 문제인지 잘모르겠어요,, 60점 나오네요

숫자가 0 포함되는 거 return false; 해줬는데도 60점이네요

###### 작성중인 코드―solution.cpp
``````1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <string>
#include <vector>
#include <iostream>
#include <cmath>

using namespace std;
bool possible(int num, vector<vector<int>> baseball) {
int n1[3] = {0};
int n2[3] = {0};
int s1=0, s2=0, cnt=0;
int tmp1=0, tmp2=0;
for(int i=1; i<=3; i++){
tmp2 = pow(10, i);
n1[i-1] = num % tmp2;
num -= n1[i-1];
if(n1[i-1]>=10) n1[i-1] = n1[i-1]/pow(10,i-1);
if(n1[i-1]==0) return false;

}

for(int i=0; i<baseball.size(); i++){
for(int j=1; j<=3; j++){
tmp2 = pow(10, j);
tmp1 = baseball[i][0];
n2[j-1] =  tmp1 % tmp2;
baseball[i][0] -= n2[j-1];
if(n2[j-1]>=10) n2[j-1] = n2[j-1]/pow(10,j-1);
}
for(int k=0; k<3; k++){
for(int l=0; l<3; l++){
if(n1[k] == n2[l]){
if(k == l){
s1+=1;
}
else {
s2+=1;
}
}
if(baseball[i][1]<s1 || baseball[i][2] < s2) {
return false;
}
}
}
if(baseball[i][1]==s1 && baseball[i][2] == s2) cnt+=1;
s1=0; s2=0;
}
if(cnt==baseball.size()) return true;
return false;
}

int solution(vector<vector<int>> baseball) {
int answer = 0;
//123, 987
for(int i=123; i<=987; i++){