#include <stdio.h>
void main()
{
long n=0,x=0,y=0;
int leng,t;
int i=0;
int m[]={11,6,17,12,12,14,5,12,16,10,11,6,14,14,4,11,6,14,14,4,11,9,12,11,10,8,10,10,16,3,4,6,10,12,16,8,10,4,16,0};
char name[42];
printf("Please input your name:");
scanf("%s",name);
while(name[i]!='\0') i++;
leng=i; /* the length of name */
if(i<4)
{
printf("The length of of your name must >3");
exit(0);
}
printf("\t Your RegCode is :");
for(i=3;i<=leng;i++)
n+=name[i]*m[i-3];
printf("%ld-",n);
for(t=2;t<leng-1;t++)
{
x=name[t]*name[t+1];
x*=(long)m[t-2];
y+=x;
}
printf("%ld\n",y);
}