Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var n, number int
- fmt.Scanln(&n)
- var minNumber = math.MaxInt64
- var maxNumber = math.MinInt64
- for i := 0; i < n; i++ {
- fmt.Scanln(&number)
- if (number < minNumber) {
- minNumber = number
- }
- if (number > maxNumber) {
- maxNumber = number
- }
- }
- fmt.Printf("Max number: %d\nMin number: %d", maxNumber, minNumber)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement