Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var speed float32
- fmt.Scanln(&speed)
- if (speed <= 10) {
- fmt.Println("slow")
- } else if (speed <= 50) {
- fmt.Println("average")
- } else if (speed <= 150) {
- fmt.Println("fast")
- } else if (speed <= 1000) {
- fmt.Println("ultra fast")
- } else if (speed > 1000) {
- fmt.Println("extremely fast")
- }
- }
- ИЛИ:
- package main
- import "fmt"
- func main() {
- var speed float32
- fmt.Scanln(&speed)
- var result = ""
- if (speed <= 10) {
- result = "slow"
- } else if (speed <= 50) {
- result = "average"
- } else if (speed <= 150) {
- result = "fast"
- } else if (speed <= 1000) {
- result = "ultra fast"
- } else if (speed > 1000) {
- result = "extremely fast"
- }
- fmt.Println(result)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement