기본 콘텐츠로 건너뛰기

8월, 2017의 게시물 표시

Password checking program

#include <stdio.h> #include <string.h> int main() {  int i;  char candi[20] = {0};  int is_lower = 0;  int is_upper = 0;  int is_digit = 0;  int is_special = 0;   while(1){  printf("Make a password : ");  scanf("%s", candi);    for(i = 0; i < strlen(candi); i++){       if((candi[i]>='a')&&(candi[i]<='z'))     is_lower += 1;          if((candi[i]>='A')&&(candi[i]<='Z'))     is_upper += 1;          if((candi[i]>='0')&&(candi[i]<='9'))     is_digit += 1;          if((candi[i]>='!')&&(candi[i]<='/'))     is_special += 1;    }       if((is_lower >= 1)&&(is_upper >= 1)&&(is_digit >= 1)){    printf("Enough password");    return 0;   }   else if ((is_lower >= 1)&&(is_upper >= 1)&&(is_digit >= 1)&&(is_special >= 1)){    printf("St