LoginSignup
0
0

More than 3 years have passed since last update.

main.go

Posted at

package main

import "fmt"
// 「math/rand」パッケージと「time」パッケージをインポートしてください
import "math/rand"
import "time"

func main() {
// 指定されたコードを貼り付けてください
rand.Seed(time.Now().Unix())

// for文を作成してください
for i:=1; i<=3; i++{
    fmt.Printf("%d回目のおみくじ結果:",i)
    number := rand.Intn(6)
    switch number {
        case 0:
            fmt.Println("凶です")
        case 1, 2:
            fmt.Println("吉です")
        case 3, 4:
            fmt.Println("中吉です")
        case 5:
            fmt.Println("大吉です")
    }
}

}

//おみくじアプリ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0