Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- int main(void)
- {
- int n = 3;
- int x, y,z, bodka = 0, veta = 0;
- x = getchar();
- if (isspace(x)) {
- while (isspace(x))
- x = getchar();
- }
- while (x != EOF) {
- if (veta == n) {
- while (x == ' ')
- x = getchar();
- veta = 0;
- bodka = 0;
- putchar('\n');
- }
- if (x == '.') {
- do {
- y = getchar();
- if (x != y){
- ungetc(y,stdin);
- veta++;
- }
- else putchar(y);
- } while (x != '.');
- }
- if (isspace(x)) {
- z = getchar();
- if (z == '.')
- veta++;
- // else ungetc(z,stdin);
- while(isspace(x))
- x = getchar();
- putchar(' ');
- }
- putchar(x);
- x = getchar();
- }
- return EXIT_SUCCESS;
- }
Add Comment
Please, Sign In to add comment