Coder-Strike 2014 - Qualification Round A. Password Check
来源:互联网 发布:如何用sql语句创建表 编辑:程序博客网 时间:2024/05/15 12:39
A. Password Check
You have probably registered on Internet sites many times. And each time you should enter your invented password. Usually the registration form automatically checks the password's crypt resistance. If the user's password isn't complex enough, a message is displayed. Today your task is to implement such an automatic check.
Web-developers of the company Q assume that a password is complex enough, if it meets all of the following conditions:
- the password length is at least 5 characters;
- the password contains at least one large English letter;
- the password contains at least one small English letter;
- the password contains at least one digit.
You are given a password. Please implement the automatic check of its complexity for company Q.
The first line contains a non-empty sequence of characters (at most100 characters). Each character is either a large English letter, or a small English letter, or a digit, or one of characters: "!", "?", ".", ",", "_".
If the password is complex enough, print message "Correct" (without the quotes), otherwise print message "Too weak" (without the quotes).
abacaba
Too weak
X12345
Too weak
CONTEST_is_STARTED!!11
Correct
代码如下:
#include<stdio.h>#include<ctype.h>#include<string.h>int es_l(char *s){ int i,ok=0; for(i=0;i<strlen(s);i++) if(isupper(s[i])) {ok=1;break;} return ok;}int es_s(char *s){ int i,ok=0; for(i=0;i<strlen(s);i++) if(islower(s[i])) {ok=1;break;} return ok;}int es_d(char *s){ int i,ok=0; for(i=0;i<strlen(s);i++) if(isdigit(s[i])) {ok=1;break;} return ok;}char lock[105];int main(){ scanf("%s",lock); if(strlen(lock)>=5&&es_l(lock)&&es_s(lock)&&es_d(lock)) printf("Correct"); else printf("Too weak");return 0;}
- Coder-Strike 2014 - Qualification Round A. Password Check
- Coder-Strike 2014 - Qualification Round——A. Password Check
- Coder-Strike 2014 - Qualification Round A. Password Check(简单字符串)
- coder-strike 2014 A Password Check
- Coder-Strike 2014 - Qualification Round C. Kicker(推理题)
- Coder-Strike 2014 - Qualification Round B. Multi-core Processor
- Coder-Strike 2014 - Qualification Round B. Multi-core Processor(模拟题)
- Coder-Strike 2014 - Round 1
- Coder-Strike 2014 - Round 1
- Coder-Strike 2014 - Round 1
- Coder-Strike 2014 - Round 2
- Coder-Strike 2014 - Round 2
- codeforces Coder-Strike 2014 Round 1 A题解题报告
- [Codeforces]Coder-Strike 2014 - Round 1
- 【索引】Coder-Strike 2014 - Round 1
- Coder-Strike 2014 - Round 1__Giving Awards
- Coder-Strike 2014 - Round 1 B. Network Configuration
- codeforces Coder-Strike 2014 Round 1 C题解题报告
- Linux下.bz2与.gz文件的区别
- C中的存储类、链接和内存管理
- java中栈与队列的实现
- BMFont中文字体图集制作的方法~(for unity ngui)
- Unity3D UI层 两个摄像头会出现两层UI的情况
- Coder-Strike 2014 - Qualification Round A. Password Check
- UVA 11255 Necklace(Polya)
- C# 使用反射动态加载子窗体
- java 关于字节流和字符流的区别
- (code jam)Problem A. Magic Trick
- 《编写高质量代码》读书笔记
- POJ 1611 The Suspects
- 【2048强势来袭】第六期:添加游戏是否还能够继续的模块
- Java—内部类