Saturday, April 19, 2014

Codeforces Coder-Strike 2014 - Qualification Round problem A - Password Check solution

Codeforces Coder-Strike 2014 - Qualification Round problem A - Password Check : http://codeforces.com/contest/411/problem/A

Codeforces Coder-Strike 2014 - Qualification Round problem A - Password Check solution : 


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int main() {
    int num, big, small;
    char s[105];
    num=big=small=0;
    scanf("%s", s);
    for(int i=0; i<strlen(s); i++) {
        if(s[i]>47 && s[i]<58) num++;
        else if(s[i]>64 && s[i]<91) big++;
        else if(s[i]>96 && s[i]<123) small++;
    }
    if(num>0 && big>0 && small>0 && strlen(s)>=5) printf("Correct");
    else printf("Too weak");
    return 0;
}

No comments:

Post a Comment