杭电2043,小细节。。。。。

#include<stdio.h>
#include<string.h>
int main()
{
    int num[10];
    char str[100]; 
    int n,a,b,c,d,e,t,i;
    while(scanf("%d",&n)!=EOF)
    {
    //getchar();
while(n--) {
      //gets(str);用这个函数输入字符时,会输入空格,用的时候注意判断;  
       scanf("%s",&str); t=strlen(str); if(t>=8&&t<=16) { a=b=c=d=e=0; for(i=0;i<t;i++) { if(str[i]>='a'&&str[i]<='z') a++; else if(str[i]>='A'&&str[i]<='Z') b++; else if(str[i]>='0'&&str[i]<='9') c++; else d++; } num[0]=a;num[1]=b;num[2]=c;num[3]=d; for(i=0;i<=3;i++) { if(num[i]!=0) e++; } if(e>=3) printf("YES "); else printf("NO "); } else printf("NO "); } } return 0; }
原文地址:https://www.cnblogs.com/soTired/p/4403524.html