#include <stdio.h>
#include<math.h>
#include <time.h>
#include <windows.h>
int main()
{
int k,i,b=0,c=0,d=0;
char a[100][20]= {"eewwe","qqweweweweqq","ooowwwwwoo"};
char answer[20] = {0};
char input;
srand(time(NULL));
k = rand()%3;
while (1)
{
//printf("%s %d",a[k], strlen(a[k]));
for(i=0; i<strlen(a[k]); i++)
{
if(answer[i]==1)
{
printf("%c", a[k][i]);
}
else
{
printf("_");
}
}
for(i=1;i<strlen(a[k]);i++)
{
if(a[i]==1)
{
d=d+1;
}
}
printf("\n");
scanf(" %c", &input);
for(i=0; i<strlen(a[k]); i++)
{
if(input == a[k][i])
{
answer[i]=1;
}
}
b=0;
for(i=0; i<strlen(a[k]); i++)//틀릴때미다 ----옆에 몃번 틀렷는지 프린트하기
{
if(answer[i]==1)
{
b=b+1;
}
}
if(b==strlen(a[k]))
{
printf("축하해");
}
Sleep(100);
}
return 0;
}