Advertisement
GerexD

asd

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