#include <stdio.h> #include <string.h> int judge(char s[]) { int flage = 0,flage_A = 0,flage_a = 0,flage_0 = 0,flage_s = 0,i,length; length = strlen(s); if(length<8||length>16) return 0; for(i=0;i<length;i++) { if('A'<=s[i]&&s[i]<='Z') flage_A = 1; else if('a'<=s[i]&&s[i]<='z') flage_a = 1; else if('0'<=s[i]&&s[i]<='9') flage_0 = 1; else if(s[i]=='!'||s[i]=='~'||s[i]=='@'||s[i]=='#'||s[i]=='$'||s[i]=='%'||s[i]=='^') flage_s = 1; else flage = 1; } if(flage_A+flage_a+flage_s+flage_0>=3&&flage != 1) return 1; } int main() { int M=1,i=0,flage[100]={0}; char s[100]={0}; scanf("%d",&M); getchar(); for(i=0;i<M;i++) { flage[i] = judge(gets(s)); } for(i=0;i<M;i++) { if(1 == flage[i]) printf("YES\n"); else printf("NO\n"); } return 0; }
0.0分
0 人评分
简单的a+b (C语言代码)浏览:674 |
众数问题 (C语言代码)浏览:911 |
简单的a+b (C语言代码)浏览:661 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:646 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:716 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:702 |
Tom数 (C语言代码)浏览:517 |
一元一次方程 (C语言代码)浏览:4245 |
1197求助浏览:667 |
自编的贪吃蛇小游戏,代码装上easyx图形库就能运行。浏览:959 |