Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class MagicCarNumbers
- {
- static void Main()
- {
- int magicWeight = int.Parse(Console.ReadLine());
- int[] X = { 10, 20, 30, 50, 80, 110, 130, 160, 200, 240 };
- int[] Y = { 10, 20, 30, 50, 80, 110, 130, 160, 200, 240 };
- int counter = 0;
- magicWeight -= 40;
- for (int a = 0; a < 10; a++)
- {
- for (int b = 0; b < 10; b++)
- {
- for (int c = 0; c < 10; c++)
- {
- for (int d = 0; d < 10; d++)
- {
- for (int i = 0; i < 10; i++)
- {
- for (int j = 0; j < 10; j++)
- {
- if ( a + b + c + d + X[i] + Y[j] == magicWeight )
- {
- if ( a == b && b == c
- || a == c && b == d
- || a == d && b == c
- || a == b && c == d
- || b == c && c == d )
- {
- counter++;
- }
- }
- }
- }
- }
- }
- }
- }
- Console.WriteLine(counter);
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement