Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var n, combinations int
- fmt.Scanln(&n)
- for a := 0; a <= n; a++ {
- for b := 0; b <= n; b++ {
- for c := 0; c <= n; c++ {
- if a + b + c == n {
- combinations++
- }
- }
- }
- }
- fmt.Println(combinations)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement