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