Hello, this is my first post so here goes!
I am working on a program that scrambles the letters of each word of a sentence in the word is 4 or more letters. But, my instructor wants us to use his algorithm to only swap the second and third characters of each word.
Basically, when I input "I don't give a damn for a man that can only spell a word one way."
It is supposed to output "I d'not gvie a dman for a man taht can olny sepll a wrod one way"
Mine says: "I d'not gvie a madn for a man taht can lnoy epsll a rowd one way"
Could you put it in code tags...it makes it 1000 times easier to read.
Another thing, when I try to compile your code, it doesn't do anything. Once I've included string because I assume you are using code::blocks and have std::string automatically included, it still doesn't work...I get black screen :\
For a start, you aren't even inputting word. Shouldn't you get the whole line and put it into a string, find the spaces, sort it into words and then go from there?
I have done it using a cin>> word; statement and done it without,
apparently, the cin >> word test in the while statement prompts me for my word automatically
It definitely intakes a string from me, and sorts them word by word. I am now thoroughly confused.
I use texteditor and my terminal on my mac to run it. I am pretty sure I am using the g++ compiler