Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var oneBGNCoinCount, twoBGNCoinCount, fiveBGNCoinCount, sum int
- fmt.Scanln(&oneBGNCoinCount)
- fmt.Scanln(&twoBGNCoinCount)
- fmt.Scanln(&fiveBGNCoinCount)
- fmt.Scanln(&sum)
- for i := 0; i <= oneBGNCoinCount; i++ {
- for j := 0; j <= twoBGNCoinCount; j++ {
- for k := 0; k <= fiveBGNCoinCount; k++ {
- if i + j * 2 + k * 5 == sum {
- fmt.Printf("%d * 1 lv. + %d * 2 lv. + %d * 5 lv. = %d lv.\n", i, j, k, sum)
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement