+ 10

Getting the scale - converting numbers to words

join replace string segment anyone know how i would go about joining and/or replacing parts of a string. sort of like a spell checker? I was thinking that I would just do a spell check type of deal maybe to sort out fivety and ten one results from the final output string https://code.sololearn.com/cuQzlPRBZNUX/#cpp Any ideas?

1st Jun 2017, 8:27 AM
jay
jay - avatar
3 odpowiedzi
+ 3
Use a dictionary
4th Jun 2017, 11:35 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
😀 But will I have to store every possible combination of numbers that would contain a ten or a teen? (50, 16 etc). Assume you are talking about std::map? I said fivety earlier as I was just putting ty in the 10's power of my code and it was outputting fivety, threety and stuff and then after it had got all the words I was going to spell check. To replace those words with the correct versions. Since then I was thinking of another approach but havent done anything cause I sorta lost motivation on this one
4th Jun 2017, 9:56 PM
jay
jay - avatar
+ 1
an answer! my saviour!
4th Jun 2017, 9:23 PM
jay
jay - avatar