fork(7) download
  1. #include <stdio.h>
  2.  
  3. f(char*s){int d=32;for(;(*s|32)>d;d=*s++|32);return!*s;}
  4.  
  5. int main(void)
  6. {
  7. int n;
  8. char tests[8][32] = {
  9. "a",
  10. "abcdefGHIjklmnopqrSTUVWXyz",
  11. "aa",
  12. "puz",
  13. "puzz",
  14. "puzZ",
  15. "puZ",
  16. "PuZ",
  17. };
  18.  
  19. char tf[2][8] = { "false", "true" };
  20.  
  21. for (n = 0; n < 8; ++n)
  22. printf("%s => %s\n", tests[n], tf[f(tests[n])]);
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
a => true
abcdefGHIjklmnopqrSTUVWXyz => true
aa => false
puz => true
puzz => false
puzZ => false
puZ => true
PuZ => true