Read a sentence from the console. Break the sentence into words using the space
ID: 3782015 • Letter: R
Question
Read a sentence from the console. Break the sentence into words using the space character as a delimiter. Iterate over each word, if the word is a numeric value then print its value doubled, otherwise print out the word, with each output on its own line.Sample Run: Sentence: Hello world, there are 3.5 items.
Output: Hello world, there are 7 items. C++ Read a sentence from the console. Break the sentence into words using the space character as a delimiter. Iterate over each word, if the word is a numeric value then print its value doubled, otherwise print out the word, with each output on its own line.
Sample Run: Sentence: Hello world, there are 3.5 items.
Output: Hello world, there are 7 items. C++ Read a sentence from the console. Break the sentence into words using the space character as a delimiter. Iterate over each word, if the word is a numeric value then print its value doubled, otherwise print out the word, with each output on its own line.
Sample Run: Sentence: Hello world, there are 3.5 items.
Output: Hello world, there are 7 items. C++
Explanation / Answer
Here is the code.Hope,it will help you.Any further questions please feel free to ask .We will love to help you
Output :
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.