15,844,477 members
See more:
`54 needs to be translated into a word. Example hi (in the alphabet h = 8, i = 9, in the amount of 17. I need, on the contrary, the sum should be 54. I know there will be a lot of words, I need to completely convert the alphabet into numbers and the sum and find it there? How can I do it please?`

What I have tried:

Posted
Updated 13-Oct-23 7:14am
v2
Mike Hankey 13-Oct-23 10:44am
If you don't know much about programming why are you attempting this?
Unless it's a programming assignment and if so you will learn nothing if you don't try and we won't do it for you!
My brother now,if i sho him he understand
Knowing
Richard MacCutchan 13-Oct-23 12:20pm
You just need to find all the combinations of letters that add up to 54. Assuming that is what the question is asking, because you have not made it clear.
Patrice T 13-Oct-23 17:54pm
To get help, you need to tell us what is your problem.

## Solution 1

(If I got you) then a simple, but rather brute force, approach would be trying all the words you have in a dictionary. You just need a function to compute the sum of the word's letters.

v2

## Solution 2

The way I'd do it is simple: I'd write an application which took the entire word list and generated the sum for each word, then stored those word's with the sum, ordered by sum ascending, and run it once to generate the data for the second app.

Then I'd write the second app: when it started, I'd load the data I pre-generated into a collection of class elements: a List<MyWord>
Then when the user enters a number, I'd use Linq to generate a subcollection of MyWord instance with the same sum, and return a random word from that sub-collection.

## Solution 3

If we're just sticking with the "title" and not whether "h = 8", then:

https://codereview.stackexchange.com/questions/102116/number-to-word-application-in-c[^]