That is a stupid problem. Why attempt to solve a problem using the wrong tools?? Loops are there for a reason and there is no glory in avoiding them when the best possible solution is to use one.
Unbelievable.
That is a stupid problem. Why attempt to solve a problem using the wrong tools?? Loops are there for a reason and there is no glory in avoiding them when the best possible solution is to use one.
Unbelievable.
Well I have an answer which meets two of Prelude's conditions....
Should I post such an atrocity or not?
Can you guess which two?
Oh, one more thing, this is the interpretation of the problem as posted by The Dog, and not some strcmp() variant.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.