STANAANDREY

pb1 10/8/2019

Oct 8th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <stdio.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     char s[256];
  10.     cin >> n;
  11.     getchar();
  12.     gets(s);
  13.     char sep[] = " .,", *p;
  14.     p = strtok(s, sep);
  15.  
  16.     while (p)
  17.     {
  18.         if (strlen(p) == n)
  19.             cout << p << endl;
  20.         p = strtok(NULL, sep);
  21.     }
  22.     return 0;
  23. }
Add Comment
Please, Sign In to add comment