#include<stdio.h>
#define MAX 10
#define key 10
void Hash_Insert(int Hash[],int n){
int i=0,t;
t=n%key;
while(i<MAX){
if(Hash[t]<=-1)
{
Hash[t]=n;break;
}
else
t=(t+1)%key;
i++;
}
if(i==MAX)
printf("Hash is full!\n");
}
void Hash_Search(int Hash[],int x){
int i=0,t;
t=x%key;
while(Hash[t]!=-1&&i<MAX){
if(Hash[t]==x)
{
printf("Hash position of %d is %d\n",x,t+1);break;
}
else
t=(t+1)%key;
i++;
}
if(Hash[t]==-1||MAX==i)
printf("No found!\n");
}
void main(){
int x,i,Hash[MAX];
for(i=0;i<MAX;i++)
Hash[i]=-1;
i=0;
scanf("%d",&x);
while(x!=-1&&i<MAX)
{
Hash_Insert(Hash,x);
scanf("%d",&x);
}
printf("Hashlist is:");
for(i=0;i<MAX;i++)
printf("%d ",Hash[i]);
printf("Input Search data:");
scanf("%d",&x);
Hash_Search(Hash,x);
}