I am a beginner coder and I have looked up and researched on how I can remove multiple spaces to a single space but I did not understand what each algorithm was meant to do. I also tried to implement their algorithms into my program in emacs but all I received were errors when I debugged them.
I've looked into Interview Question : Trim multiple consecutive spaces from a string and Replace multiple spaces with one space in a string but I had no success.
The image shows what I am trying to do. Taking the spaces between cin and cout and converting them into one. enter image description here I've already coded everything except the multiple spaces.
If anyone can clearly explain how I can do this it would be much appreciated!
Aucun commentaire:
Enregistrer un commentaire