Advertisement
Spocoman

Bonus Score

Oct 3rd, 2024
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.45 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var number int
  7.     fmt.Scanln(&number)
  8.  
  9.     bonus := 0.0
  10.  
  11.     if number <= 100 {
  12.         bonus = 5
  13.     } else if number > 1000 {
  14.         bonus = float64(number) * 0.1
  15.     } else {
  16.         bonus = float64(number) * 0.2
  17.     }
  18.  
  19.     if number % 2 == 0 {
  20.         bonus++
  21.     } else if number % 10 == 5 {
  22.         bonus += 2
  23.     }
  24.  
  25.     fmt.Printf("%f\n%f\n", bonus, float64(number) + bonus)
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement