+ 1
How to turn user input into numbers
How do you take some use input, for example sun and turn it into numbers like 19, 21, 14 which are their place in the alphabet.
3 ответов
+ 2
easy, but relatively long way:
make cases like
switch input
case "a" {
output 1}
or the harder way:
take the charcode of the input
(a = 65, b = 66 and so on) and then do charcode - 64 to get the place of the alphabet
+ 2
here you go:
https://code.sololearn.com/cr6NNgmLQmXr/?ref=app
+ 1
thanks for the answers