fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <stdbool.h>
  4. #include <string.h>
  5.  
  6. int main(void) {
  7. char input[100];
  8. scanf("%99s", input);
  9.  
  10. bool c1, c2, c3, c4;
  11. c1 = c2 = c3 = c4 = false;
  12.  
  13. for (int i = 0; i < strlen(input); i++) {
  14. char c = input[i];
  15. if (isupper(c)) {
  16. c1 = true;
  17. } else if (islower(c)) {
  18. c2 = true;
  19. } else if (isdigit(c)) {
  20. c3 = true;
  21. } else {
  22. c4 = true;
  23. }
  24. }
  25.  
  26. int strength = c1 + c2 + c3 + c4;
  27. bool longEnough = strlen(input) > 8;
  28. if(!longEnough) {
  29. printf("Too Short.");
  30. }
  31. else{
  32. if(strength >=3){
  33. printf("Strong.");
  34. }
  35. else if(strength >= 2){
  36. printf("Medium.");
  37. }
  38. else {
  39. printf("Low.");
  40. }
  41. }
  42.  
  43. return 0;
  44. }
Success #stdin #stdout 0s 5280KB
stdin
PASSWORD
stdout
Too Short.