Advertisement
cd62131

Words

Aug 5th, 2014
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stddef.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. int main() {
  5.   const int n = 1024;
  6.   char s1[n], *tok, *first = "";
  7.   const char *s2 = " ,.\n";
  8.   size_t len;
  9.   fgets(s1, n, stdin);
  10.   for (tok = strtok(s1, s2); tok; tok = strtok(NULL, s2)) {
  11.     len = strlen(tok);
  12.     if (len <= 2 || 7 <= len) continue;
  13.     printf("%s%s", first, tok);
  14.     first = " ";
  15.   }
  16.   printf("\n");
  17.   return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement