fork download
  1. #include <unistd.h>
  2. #include <stdio.h>
  3.  
  4. int is_whitespace(char c)
  5. {
  6. //printf("%c", c);
  7. if(c == '\t' || c == '\n' || c == '\r' || c == ' ')
  8. return (1);
  9. else
  10. return (0);
  11. }
  12.  
  13. int main(int argc, int **argv)
  14. {
  15. int i;
  16.  
  17. i = 0;
  18. if(argc == 2)
  19. {
  20. while(is_whitespace(argv[1][i]) == 1)
  21. i++;
  22. while(is_whitespace(argv[1][i]) == 0 && argv[1][i] != 0)
  23. {
  24. write(1, &(argv[1][i]), 1);
  25. //printf("%c", argv[1][i]);
  26. i++;
  27. }
  28. }
  29.  
  30. write(1, "\n", 1);
  31. }
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout