Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4.  
  5.  
  6. int main(void)
  7. {
  8. FILE *f;
  9. f = fopen("test.txt", "r+");
  10. if (f == NULL)
  11. {
  12. printf("File Error);
  13. }
  14. else
  15. {
  16. int c;
  17. c = 0;
  18.  
  19. while ((c = fgetc(f)) != EOF)
  20. {
  21. if (c == ' ') // или if ( isspace(c) )
  22. // заменить на " _ "
  23.  
  24. putchar(c);
  25. }
  26.  
  27. }
  28. fclose(f);
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement