做题思路:最好是定义四个flag变量来进行标记,满足一个条件,就使 flag=1,只要满足有 4个flag之和大于等于3就为安全密码; 代码实现: #include <stdio.h>#include<string.h>intmain() {intm,i,j,len;intflag1,flag2,flag3,flag4;chars[55]; scanf("%d",&m);while(m--) { scanf("%s",s); flag1...
C++练习 - HDU2043 Problem - 2043 判断输入字符串长度是否为8~16位 判断字符是否为数字、小写字母、大写字母、特殊符号 #include<iostream>#include<string>usingnamespacestd;boolis_digit(charc){returnc>='0'&&c<='9';}boolis_lowercase(charc){returnc>='a'&&c<='z';}boolis_uppercase(charc){re...
hdu 2043密码 密码 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29823 Accepted Submission(s): 11976 Problem Description 网上流传一句话:"常在网上飘啊,哪能不挨刀啊~"。其实要想能安安心心地上网其实也不难,学点安全知识就可以。首先,我...
HDU2043密码问题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2043 代码:#include <iostream> #include <algorithm> #include <cstring> using namespace std; int main() { int m,i,k; int a,b,c,d; char s[51]; cin>>m; getchar();...
[恢]hdu 2043 2011-12-20 02:48:53 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2043 题意:中文。 代码: # include <stdio.h> charstr[60] ; inttest (charstr[]) { inti, flag[4] = {0,0,0,0} ; for(i =0; str[i] ; i++)...
include<string.h> main(){ int a,b,c,d,i,j,k,e,q,w;char s[51];scanf("%d",&a);while(a){ b=0;c=0;d=0;k=0;e=0;a--;scanf("%s",s); // 用scanf比较安全, gets难处理.if(strlen(s)>16||strlen(s)<8) // 你忘了检测长度 { printf("NO\n");continue;} fo...
Hdu 2043密码 密码Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 56516 Accepted Submission(s): 22886 Problem Descr... HDU-2043 密码 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Descrip...
hdu 2043 密码 密码 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 30440 Accepted Submission(s): 12254 Problem Description 网上流传一句话:"常在网上飘啊,哪能不挨刀啊~"。其实要想能安安心心地上网其实也不难,学点安全知识就可以。
/* HDU2043 密码 */ #include <stdio.h> #include <string.h> int main(void) { int m, count, f1, f2, f3, f4, len, i; char s[256], t4[]="~!@#$%^", *p; scanf("%d", &m); while(m--) { // 读入字符串 scanf("%s", s); // 密码检查 count = 0; f1 = f2 = f3 ...
HDU 2043 密码 Problem Description 网上流传一句话:"常在网上飘啊,哪能不挨刀啊~"。其实要想能安安心心地上网其实也不难,学点安全知识就可以。 首先,我们就要设置一个安全的密码。那什么样的密码才叫安全的呢?一般来说一个比较安全的密码至少应该满足下面两个条件:...