Challenge #1 solved

0 Vladimir Djukic · June 2, 2015
Any other way? :)


    char password[20];
    int brojac = 0;
    int upper = 0;
    int num = 0;
    int dolar = 0;
    scanf(" %s", password);
    for(brojac;brojac <= sizeof(password);brojac++){
        if(isupper(password[brojac])){
            if(upper < 1){
            upper++;
            }
        }else if(isdigit(password[brojac])){
            if(num<1){
            num++;
            }
        }else if(password[brojac] == '$'){
            if(dolar<1){
             dolar++;
            }
        }
    }
    if(num + upper + dolar >= 3){
        printf("Good password %d",num + upper + dolar);
    }else{
        printf("Bad password %d", num + upper + dolar);
    }

Post a Reply

Replies

Oldest  Newest  Rating
0 Vladimir Djukic · June 4, 2015
Code tag not working... I reupload main post :)
0 Suraj Gautam · June 2, 2015
What is this? 
  • 1

C

107,091 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator