Advertisement
Spocoman

02. Bonus Score

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