Skip to content

Commit

Permalink
infinate loop findian
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangbits committed Jun 2, 2020
1 parent ebbe1f3 commit ae56a59
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions c1-m2-activity/findian.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ a in between
*/

func main() {
var findString string
fmt.Printf("Please input a string: ")
num, err := fmt.Scan(&findString)
if err != nil {
fmt.Printf(err.Error() + string(num))
}
for {
var findString string
fmt.Printf("Please input a string: ")
num, err := fmt.Scan(&findString)
if err != nil {
fmt.Printf(err.Error() + string(num))
}

if findian(findString) {
fmt.Printf("Found!\n")
} else {
fmt.Printf("Not Found!\n")
if findian(findString) {
fmt.Printf("Found!\n")
} else {
fmt.Printf("Not Found!\n")
}
}

}
Expand Down

0 comments on commit ae56a59

Please sign in to comment.