Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. char s[101], sc[101], *cuv;
  9. int n;
  10. cin>>n;
  11. cin.get();
  12. cin.getline(s, 101);
  13.  
  14. strcpy(sc, s);
  15. cuv = strtok(sc, " ");
  16. while (cuv)
  17. {
  18. if (strlen(cuv)>=n)
  19. cout<<cuv<<endl;
  20. cuv = strtok(NULL, " ");
  21. }
  22.  
  23. cuv = strtok(s, " ");
  24. while (cuv)
  25. {
  26. if (strlen(cuv)<n)
  27. cout<<cuv<<endl;
  28. cuv = strtok(NULL, " ");
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement