Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Combination
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int counter = 0;
- for (int i = 0; i <= n; i++)
- {
- for (int j = 0; j <= n-i; j++)
- {
- for (int k = 0; k <= n-j-i; k++)
- {
- for (int l = 0; l <= n-k-j-i; l++)
- {
- for (int m = 0; m <= n-l-k-j-i; m++)
- {
- if (i + j + k + l + m == n)
- {
- counter++;
- }
- }
- }
- }
- }
- }
- Console.WriteLine(counter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement