Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (Sesiunea specială, 29 mai 2019)
- (Incercare)
- 2. #include<iostream>
- #include<cstring>
- using namespace std;
- char x[1001], *p;
- int main()
- {
- int i, n, c=0;
- cin>>n;
- cin.get();
- cin.getline(x, 1001);
- p=strtok(x, " ");
- while(p!=0)
- {
- c++;
- if(strlen(p)==n)
- {
- cout<<p<<'\n';
- }
- if(strlen(p)!=n)
- {
- c--;
- }
- p=strtok(0, " ");
- }
- if(c==0)
- {
- cout<<"nu exista";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement