Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var number int
- fmt.Scanln(&number)
- bonus := 0.0
- if number <= 100 {
- bonus = 5
- } else if number > 1000 {
- bonus = float64(number) * 0.1
- } else {
- bonus = float64(number) * 0.2
- }
- if number % 2 == 0 {
- bonus++
- } else if number % 10 == 5 {
- bonus += 2
- }
- fmt.Printf("%f\n%f\n", bonus, float64(number) + bonus)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement