Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var username, password string
- fmt.Scanln(&username)
- fmt.Scanln(&password)
- var input = ""
- for ;; {
- fmt.Scanln(&input)
- if input == password {
- fmt.Println("Welcome " + username + "!")
- break
- }
- }
- }
- ИЛИ:
- package main
- import "fmt"
- func main() {
- var username, password string
- fmt.Scanln(&username)
- fmt.Scanln(&password)
- var input string
- fmt.Scanln(&input)
- for i := 0 ; input != password; i++ {
- fmt.Scanln(&input)
- }
- fmt.Println("Welcome " + username + "!")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement