CodeForces 411A Password Check

CodeForces 411A  Password Check

Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u


Description

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.

Input

The first line contains a non-empty sequence of characters (at most 100 characters). Each character is either a large English letter, or a small English letter, or a digit, or one of characters: "!", "?", ".", ",", "_".

Output

If the password is complex enough, print message "Correct" (without the quotes), otherwise print message "Too weak" (without the quotes).

Sample Input

Input
abacaba
Output
Too weak
Input
X12345
Output
Too weak
Input
CONTEST_is_STARTED!!11
Output
Correct

#include<stdio.h>
#include<string.h>
int main(){
	char s[111];
	int i,len,num1,num2,num3;
	while(scanf("%s",&s)!=EOF){
		num1=0;num2=0;num3=0;
		len=strlen(s);
		if(len<5){
			printf("Too weak\n");
		}
		else{
			for(i=0;i<len-1;i++){
				if(s[i]>='0'&&s[i]<='9'){
					num1++;
				}
				else if(s[i]>='a'&&s[i]<='z'){
					num2++;
				}
				else if(s[i]>='A'&&s[i]<='Z'){
					num3++;
				}
			}
			if(num1>0&&num2>0&&num3>0){
				printf("Correct\n");
			}
			else{
				printf("Too weak\n");
			}
		}
		memset(s,'\0',sizeof(s));
	}
	return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值