fork(1) download
  1. #include <stdio.h>
  2. /* Упражнение 1.13 */
  3.  
  4. int main()
  5. {
  6. int c, i, nword;
  7. nword = 0;
  8. while ((c = getchar()) != EOF)
  9. {
  10. if ((c != ' ') && (c != '\n') && (c != '\t'))
  11. ++nword;
  12. else
  13. {
  14. for (i = 0; i < nword; ++i)
  15. printf("-");
  16. printf("\n");
  17. nword = 0;
  18. }
  19. }
  20. }
Success #stdin #stdout 0s 9432KB
stdin
test string 1
test string 22
test string 333
stdout
----
------
-
----
------
--
----
------
---