Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Combinations
- {
- class Program
- {
- static void Main(string[] args)
- {
- int num = int.Parse(Console.ReadLine());
- int counter = 0;
- for (x = 0; x <= num; x++)
- {
- for (y = 0; y <= num; y++)
- {
- for (z = 0; z <= num; z++)
- {
- if (num == x + y + z)
- {
- counter++;
- }
- }
- }
- }
- Console.WriteLine(counter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement