Guest User

Untitled

a guest
Jul 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6. int main(void)
  7. {
  8. int n = 3;
  9. int x, y,z, bodka = 0, veta = 0;
  10.  
  11. x = getchar();
  12. if (isspace(x)) {
  13. while (isspace(x))
  14. x = getchar();
  15. }
  16.  
  17. while (x != EOF) {
  18. if (veta == n) {
  19. while (x == ' ')
  20. x = getchar();
  21. veta = 0;
  22. bodka = 0;
  23. putchar('\n');
  24. }
  25.  
  26. if (x == '.') {
  27. do {
  28. y = getchar();
  29. if (x != y){
  30. ungetc(y,stdin);
  31. veta++;
  32. }
  33. else putchar(y);
  34. } while (x != '.');
  35. }
  36.  
  37. if (isspace(x)) {
  38. z = getchar();
  39. if (z == '.')
  40. veta++;
  41. // else ungetc(z,stdin);
  42. while(isspace(x))
  43. x = getchar();
  44. putchar(' ');
  45. }
  46.  
  47. putchar(x);
  48. x = getchar();
  49. }
  50.  
  51. return EXIT_SUCCESS;
  52. }
Add Comment
Please, Sign In to add comment