Advertisement
Spocoman

02. Greater Number

Sep 16th, 2024
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.41 KB | None | 0 0
  1. package main
  2. import "fmt"
  3.  
  4. func main() {
  5.     var num1, num2 int
  6.     fmt.Scanln(&num1)
  7.     fmt.Scanln(&num2)
  8.    
  9.     if (num1 > num2) {
  10.         fmt.Println(num1)
  11.     } else {
  12.         fmt.Println(num2)
  13.     }
  14. }
  15.  
  16. ИЛИ:
  17.  
  18. package main
  19. import (
  20.     "fmt"
  21.     "math"
  22. )
  23.  
  24. func main() {
  25.     var num1, num2 float64
  26.     fmt.Scanln(&num1)
  27.     fmt.Scanln(&num2)
  28.    
  29.     fmt.Println(math.Max(num1, num2))
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement