How to resolve the algorithm Odd word problem step by step in the Phix programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Odd word problem step by step in the Phix programming language

Table of Contents

Problem Statement

Write a program that solves the odd word problem with the restrictions given below.

You are promised an input stream consisting of English letters and punctuations.
It is guaranteed that:

A stream with six words:

The task is to reverse the letters in every other word while leaving punctuations intact, producing: while observing the following restrictions:

Work on both the   "life"   example given above, and also the text:

Let's start with the solution: