#include<stdio.h>
#include<math.h>
#include<time.h>
#include<windows.h>
void gotoxy(int x,int y)
{
COORD pos= {x,y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int main()
{
char words[10][20] = {"apple", "kiwi", "melon", "banana", "mandarin", "orange"};
char ans[20] = {0};
char inp;
int r, x, y, a, b, c, i,j;
srand(time(NULL));
r = rand()%6;
printf("answer is %s\n", words[r]);
for(;;)
{
scanf(" %c", &inp);
for(i=0;i<strlen(words[r]);i++){
if(inp==words[r][i]){
ans[i]=1;
}
}
for(i=0; i<strlen(words[r]); i++)
{
if(ans[i]==0)
{
printf("_");
}
else
{
printf("%c", words[r][i]);
}
}
printf("\n");
}
}