0
C++ problem
So we have a text of maximum 100 characters, each word is divided by a space. The problem says that we have to replace all the even length words with # and then write the text ... can someone help with an algorithm in C++?
17 Answers
+ 2
Comments and modified code included as comments in your code. Probably should have posted here 🙄
+ 2
Can you create a new code in the code playground on SoloLearn and enter what you've tried on paper?
+ 1
can you just bring an example
+ 1
as I understand we should replace even length words into another string element isn't it??
+ 1
do u need an algorithm?
+ 1
I will post the code later, ok
+ 1
it is difficult to explain by chat
+ 1
Have you at least made an attempt. People are happy to help, but certainly not do your homework.
+ 1
whenever you have time... Our school teacher ain't that great and we are struggling to understand some thing... and by we I mean the whole class. Thanks a lot!
+ 1
I actually have an attempt... but it's on paper and I realised that it's wrong before I posted... in my example the algorithm writes each word and then no word if there's no word ... too bad I can't take a photo. Plus it ain't my homework it's just me exercising for the finals.
+ 1
https://code.sololearn.com/ctDBwATEI0py/?ref=app
From what I remember this is the piece of code. I don't have my notebook with me but as I said is not right.
+ 1
Thanks a lot !
0
twist... if there are no even words the programm will write "No words found" INSTEAD of the text
0
I don't have one right now
0
yes... we should replace even length words with #, odd words stays the same.
0
yes
0
in a few minutes