a53

Bac_Cuvinte

a53
Jun 16th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char text[101];
  8. cin.getline(text,101);
  9. unsigned int n;
  10. cin>>n;
  11. bool ok=false;
  12. char *cuvant=strtok(text," ");
  13. while(cuvant!=NULL)
  14. {
  15. if(strlen(cuvant)==n)
  16. cout<<cuvant<<'\n',ok=true;
  17. cuvant=strtok(NULL," ");
  18. }
  19. if(!ok)
  20. cout<<"nu exista";
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment