Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stddef.h>
- #include <stdio.h>
- #include <string.h>
- int main() {
- const int n = 1024;
- char s1[n], *tok, *first = "";
- const char *s2 = " ,.\n";
- size_t len;
- fgets(s1, n, stdin);
- for (tok = strtok(s1, s2); tok; tok = strtok(NULL, s2)) {
- len = strlen(tok);
- if (len <= 2 || 7 <= len) continue;
- printf("%s%s", first, tok);
- first = " ";
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement