Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char u;
- string s,g;
- int volt=0;
- string szo="";
- getline(cin,s);
- for(int i=0;i<=s.length();i++)
- {
- if(s[i]!=' ' and i!=s.length())
- {
- szo=szo+s[i];
- }
- else {
- if(volt==0){ volt=1;
- g=g+" "+szo+" ";
- u=s[i-1];
- szo="";
- }
- else
- {
- if(s[i-1]==u) g=g+" success "+szo;
- else g=g+" "+szo+" ";
- volt = 0;
- szo="";
- u=s[i-1];
- }
- }
- }
- cout<<g;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement