Advertisement
Spocoman

07. Min Number

Sep 22nd, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.37 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "math"
  6.     "strconv"
  7. )
  8.  
  9. func main() {
  10.     var input string
  11.     fmt.Scanln(&input)
  12.    
  13.     var minNum = math.MaxInt64
  14.  
  15.     for i := 0; input != "Stop"; i++ {
  16.         n,_ := strconv.Atoi(input)
  17.         if n < minNum {
  18.             minNum = n
  19.         }
  20.         fmt.Scanln(&input)
  21.     }
  22.        
  23.     fmt.Println(minNum)
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement