{{{~cpp #include #include using namespace std; int main() { int num; int strike=0; int ball=0; int rmatch[3]; do { srand((time(0))); rmatch[0] = rand() % 10; srand((time(0))); rmatch[1] = rand() % 10; rmatch[2] = rand() % 10;} while(rmatch[0]==rmatch[1] || rmatch[1]==rmatch[2] || rmatch[0]==rmatch[2]); cout << rmatch[0]<< rmatch[1]<< rmatch[2]; cout<<"야구게임을 해 봅시닷! 수를 입력하세요. 단 세자리여야 합니다.\n" ; cin >> num; int match[3]; match[0]=num/100; match[1]=(num%100)/10; match[2]=num%10; int check=0; if(num>100 && num<999) { for(int i=0;i<3&& check==0;i++) { for(int j=0;j<3 && check==0;j++) { if(i==j && match[i]==rmatch[j]) strike++; else if(i!=j && match[i]==rmatch[j]) ball++; } } if(strike==0 && ball==0) cout<<"out...\n"; else {cout<< endl <