int main()
{
const int MIN_LEN_OF_NAME=10;
const int MAX_LEN_OF_NAME=24;
char name[MAX_LEN_OF_STRING]="";
char sn[MAX_LEN_OF_STRING]="";
char magicString[]="i am Bin Laden";
int lenOfName,
lenOfMagicString,
lastCharIndex,
lenOfSerial;
int i,j;
//录入用户名,确保符合长度
do{
printf("Plz input your name:");
scanf("%s", name);
lenOfName = strlen(name);
if(lenOfName < MIN_LEN_OF_NAME)
printf("Name should be at least %d characters!\r\n", MIN_LEN_OF_NAME);
else if(lenOfName > MAX_LEN_OF_NAME)
printf("Name should no more than %d characters!\r\n", MAX_LEN_OF_NAME);
else
goto goodway;
}while(1);