Last active
January 11, 2020 20:26
-
-
Save mrcat323/6d5bd4b338b7b79f84040d3be291d81e to your computer and use it in GitHub Desktop.
Fold task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
char t; | |
int n; | |
int pc, c, nc, nw; | |
// scanf("%d", &n); | |
n = 10; | |
nc = nw = 0; | |
while ((c = getchar()) != EOF) { | |
if (nc != 0 && nc % n == 0) { | |
/* abdurahmon hasanov */ | |
if (c == ' ' || c == '\t' || c == ',' || c == '.' || c == ';' || c == ':') | |
putchar('\n'); | |
else if (c != ' ') { | |
putchar(c); | |
continue; | |
} | |
} | |
putchar(c); | |
++nc; | |
pc = c; | |
if (c == '\n') | |
nc = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment