fork download
  1. #include <stdio.h>
  2.  
  3. // Exercise 1-12
  4. // Copy input to output, one word per line
  5. // words deleniated by tab, backspace, \ and space
  6.  
  7. int main()
  8. {
  9. int c;
  10.  
  11. while ((c = getchar()) != EOF) {
  12. if ( c == '\t') {
  13. c = getchar();
  14. printf("\n");
  15. }
  16. else if ( c == '\b') {
  17. c = getchar();
  18. printf("\n");
  19. }
  20. else if ( c == '\\') {
  21. c = getchar();
  22. printf("\n");
  23. }
  24. else if ( c == ' ') {
  25. c = getchar();
  26. printf("\n");
  27. }
  28. putchar(c);
  29. }
  30. return 0;
  31. }
Success #stdin #stdout 0s 2296KB
stdin
aaaaaaa sssss       fffffffffff
stdout
aaaaaaa
sssss
 
 
 
fffffffffff