Josif_tepe

Untitled

Aug 22nd, 2025
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.88 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5.  
  6. int main(void) {
  7.    
  8.     char a[2000];
  9.     scanf("%s", a);
  10.    
  11.     int golemi_bukvi = 0;
  12.     int mali_bukvi = 0;
  13.     int cifri = 0;
  14.     int specijalni_karakteri = 0;
  15.    
  16.    
  17.     for(int i = 0; i < strlen(a); i++) {
  18.         if(isalpha(a[i])) {
  19.             if(islower(a[i])) {
  20.                 mali_bukvi++;
  21.             }
  22.             else {
  23.                 golemi_bukvi++;
  24.             }
  25.         }
  26.        
  27.         if(isdigit(a[i])) {
  28.             cifri++;
  29.         }
  30.        
  31.         if(isalnum(a[i]) == 0) {
  32.             specijalni_karakteri++;
  33.         }
  34.        
  35.     }
  36.  
  37.     if(strlen(a) >= 8 && golemi_bukvi >= 1 && mali_bukvi >= 1 && cifri >= 2 && specijalni_karakteri >= 1) {
  38.         printf("SILNA\n");
  39.     }
  40.     else {
  41.         printf("SLABA\n");
  42.     }
  43.    
  44.    
  45.     return 0;
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment