0
Go coding help needed with this problem
Hello community. I would like your help regarding this task from SoloLearn. I really dont know how to take an input and output the corresponding Number name as String. Example: input (2) and get Two output. Thanks for the help You are making a robot that can speak numbers. Your robot should take 3 numbers in the range of 0-10 as input and output the corresponding texts in English. Sample Input: 8 0 5 Sample Output: Eight Zero Five
2 Answers
0
you can use a for loop to get three inputs.
var n int
for i:=0; i < 3 ; i++{
fmt.Scanln(&n)
your conditions to output strings
use if or switch
}
0
Puedes utilizar switch y en los case 1 : System.out.println("uno");
O poner un array con los nĂșmeros en letras ["uno","dos","tres","cuatro",...] y restarle uno al nĂșmero del Scanner, porque las posiciones de los arrays empiezan por cero.