First split each line, so that each word is in a separate string.
Count the number of words.
If it's even use a for loop to process it in pairs:
for (int i = 0; i < numberOfWords; i += 2)
{
...
}
Inside the loop, add the word at indexes i and i + 1 to the output. Add your string as well.