Advertisement
GerexD

asdd

Jun 18th, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. char u,u2;
  2. string s,g;
  3. string szo="",szo2="";
  4. getline(cin,s);
  5. int k=0;
  6. while(s[k]!=' ')
  7. {
  8. szo=szo+s[k];
  9. k++;
  10. }
  11. u=s[k-1];
  12. g=szo;
  13. for(int i=k;i<=s.length();i++)
  14. {
  15. if(s[i]!=' ' and i!=s.length()){
  16. szo2=szo2+s[i];
  17. }
  18. else {
  19. u2=s[i-1];
  20. if(u==u2) g=g+" succes "+szo2;
  21. else g=g+" "+szo2;
  22. szo=szo2;
  23. szo2="";
  24. u=u2;
  25. }
  26. }
  27. cout<<g;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement