Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 54994 Accepted Submission(s): 22267
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { int n; char str[55]; int a,b,c,d; int t; scanf("%d",&n); while(n--){ t=0; a=b=c=d=0; scanf("%s",str); int len=strlen(str); for(int i=0;i<len;i++){ if(str[i]>=‘A‘&&str[i]<=‘Z‘){ a=1; }else if(str[i]>=‘a‘&&str[i]<=‘z‘){ b=1; }else if(str[i]>=‘0‘&&str[i]<=‘9‘){ c=1; }else { d=1; } } t=a+b+c+d; if(t>=3&&len>=8&&len<=16){ printf("YES\n"); }else{ printf("NO\n"); } } return 0; }
原文:http://www.cnblogs.com/TWS-YIFEI/p/6714987.html