~cpp
#include<iostream>
#include<ctime>
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 <<strike << ":트크\n";
cout<< ball << ":\n";}
}
else
cout<<" 하 ~\n";
return 0;
}
~ ~ ㅜ_ㅜ 한 해 ...~