Created
March 15, 2023 04:40
-
-
Save VTRyo/f5c28a94cf826ca91f366b34f4bb43dd to your computer and use it in GitHub Desktop.
Do you have everything?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
func main() { | |
q1 := "あなたには家族がいますか?" | |
q2 := "あなたには子どもがいますか?" | |
q3 := "あなたの住居は持ち家ですか?" | |
q4 := "あなたは車を持っていますか?" | |
q5 := "あなたは太い実家を持っていますか?" | |
q6 := "あなたは社会的信用がありますか?" | |
reader := bufio.NewReader(os.Stdin) | |
questions := []string{q1, q2, q3, q4, q5, q6} | |
for i, q := range questions { | |
fmt.Printf("%s? (yes/no)", q) | |
answer, _ := reader.ReadString('\n') | |
if answer == "no\n" { | |
fmt.Println("あなたはすべてを持たない者です") | |
return | |
} | |
if i == len(questions)-1 { | |
fmt.Println("あなたはすべてを持つ者です") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment