密码要求:
1.长度超过8位
2.包括大小写字母.数字.其它符号,以上四种至少三种
3.不能有相同长度超2的子串重复
说明:长度超过2的子串
#include"stdio.h"
#include"string.h"
int process_str(char str[])
{
int len,i,rep,Lowercase=0,Uppercase=0,Digit=0,others=0;
int j;
len = strlen(str);
if(len <= 8){
printf("NG\n");
return 0;
}
for(i=0;i<len;i++){
if(str[i]>='a' && str[i]<='z'){
Lowercase = 1;
}
else if(str[i]>='A' &&str[i]<='Z'){
Uppercase = 1;
}
else if (str[i]>='0' && str[i]<='9'){
Digit = 1;
}
else{
others = 1;
}
}
rep = Lowercase + Uppercase + Digit + others;
if(rep <= 2){
printf("NG\n");
return 0;
}
int array[len+1][len+1] ;
memset(array,0,sizeof(array));
for(i=