fork(2) download
  1. #include <stdio.h>
  2.  
  3. int passval(char * p)
  4. {
  5. int capital=0, small=0, digit=0;
  6.  
  7. while (*p && !(capital && small && digit))
  8. capital = (*p>='A' && *p<='Z' ? 1 : capital),
  9. small = (*p>='a' && *p<='z' ? 1 : small ),
  10. digit = (*p>='0' && *p<='9' ? 1 : digit ),
  11. p++ ;
  12.  
  13. return capital && small && digit;
  14. }
  15.  
  16. int main(void)
  17. {
  18. char * test = "abcD12";
  19. printf("%s ~ %d", test, passval(test));
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
abcD12 ~ 1