0
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 c
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 How to make Program ??
10 Antworten
+ 11
package main
import "fmt"
func main() {
//your code goes here
for i := 1; i<=3; i++{
var i int
fmt.Scanln(&i)
switch i {
case 0:
fmt.Println("Zero")
case 1:
fmt.Println("One")
case 2:
fmt.Println("Two")
case 3:
fmt.Println("Three")
case 4:
fmt.Println("Four")
case 5:
fmt.Println("Five")
case 6:
fmt.Println("Six")
case 7:
fmt.Println("Seven")
case 8:
fmt.Println("Eight")
case 9:
fmt.Println("Nine")
case 10:
fmt.Println("Ten")
default:
fmt.Println(i)
}
}
}
0
use switch for that in " C "!
0
This challenge is similar to the code coach No Numerals, except for multiline inputs. If you have done the code coach challae you only have to loop the input for some interval, in this case 3.
0
Vrushabh Dhanraj Lewade just loop over the switch take user input inside and the range of the loops should be 3
0
Thank you so much .
0
Please help me aut can someone send me full code
0
Vrushabh Dhanraj lewade thank you so much bro
0
My pleasure
0
package main
import "fmt"
func main() {
//your code goes here
var i int
fmt.Scanln(&i)
switch i {
case 1:
fmt.Println("One")
case 2:
fmt.Println("Two")
case 3:
fmt.Println("Three")
case 4:
fmt.Println("Four")
case 5:
fmt.Println("Five")
case 6:
fmt.Println("Six")
case 7:
fmt.Println("Seven")
case 8:
fmt.Println("Eight")
case 9:
fmt.Println("Nine")
case 10:
fmt.Println("Ten")
}
var b int
fmt.Scanln(&b)
switch b {
case 1:
fmt.Println("One")
case 2:
fmt.Println("Two")
case 3:
fmt.Println("Three")
case 4:
fmt.Println("Four")
case 5:
fmt.Println("Five")
case 6:
fmt.Println("Six")
case 7:
fmt.Println("Seven")
case 8:
fmt.Println("Eight")
case 9:
fmt.Println("Nine")
case 10:
fmt.Println("Ten")
}
var c int
fmt.Scanln(&c)
switch c {
case 1:
fmt.Println("One")
case 2:
fmt.Println("Two")
case 3:
fmt.Println("Three")
case 4:
fmt.Println("Four")
case 5:
fmt.Println("Five")
case 6:
fmt.Println("Six")
case 7:
fmt.Println("Seven")
case 8:
fmt.Println("Eight")
case 9:
fmt.Println("Nine")
case 10:
fmt.Println("Ten")
}
}
IT WORKS BUT TEST CASE 3 WRITES THAT IT'S WRONG!!! WHY?
0
package main
import "fmt"
func main() {
for i:=1;i<4;i++ {
var i int
fmt.Scanln(&i)
switch i {
case 0:
fmt.Println("Zero")
case 1:
fmt.Println("One")
case 2:
fmt.Println("Two")
case 3:
fmt.Println("Three")
case 4:
fmt.Println("four")
case 5:
fmt.Println("Five")
case 6:
fmt.Println("Six")
case 7:
fmt.Println("Seven")
case 8:
fmt.Println("Eight")
case 9:
fmt.Println("Nine")
case 10:
fmt.Println("Ten")
default:
fmt.Println(i)
}
}
}
somewhat test case 3 is still not solved.