Click here to Skip to main content
15,844,477 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
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:

Please help help help me pleaseplease
Posted
Updated 13-Oct-23 7:14am
v2
Comments
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!
Saleh Ferzelizade 13-Oct-23 10:54am    
My brother now,if i sho him he understand
Saleh Ferzelizade 13-Oct-23 10:54am    
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.

(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.
 
Share this answer
 
v2
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.
 
Share this answer
 
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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900