Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char text[101];
- cin.getline(text,101);
- unsigned int n;
- cin>>n;
- bool ok=false;
- char *cuvant=strtok(text," ");
- while(cuvant!=NULL)
- {
- if(strlen(cuvant)==n)
- cout<<cuvant<<'\n',ok=true;
- cuvant=strtok(NULL," ");
- }
- if(!ok)
- cout<<"nu exista";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment