Advertisement
Denistod

Untitled

Nov 16th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. char x[110],*p,mici[110],mari[110];
  5. int main()
  6. {
  7. int n;
  8. cin>>n;
  9. cin.get();
  10. cin.getline(x,110);
  11. p=strtok(x," ");
  12. while(p!=0)
  13. {
  14. if(strlen(p)>=n)
  15. {
  16. strcat(mari,p);
  17. strcat(mari,"\n");
  18. }
  19. else
  20. {
  21. strcat(mici,p);
  22. strcat(mici,"\n");
  23. }
  24. p=strtok(0," ");
  25. }
  26. if(strlen(mari)!=0&&strlen(mici)!=0)
  27. {
  28. cout<<mari<<mici;
  29. }
  30. else
  31. {
  32. cout<<"NU EXISTA";
  33. }
  34. return 0;
  35. }
  36. pb 2 2020
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement