just use a simple for loop to iterate over the array of chars...if a d is found increment a counter, if counter >= 3, output D, reset counter to 0 if anything other than a d is found. if an e is found and your d counter is >= 1, reset d counter, if the next letter is a d, output an E. etc...
No comments:
Post a Comment