Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private long calculate()
- {
- int points = 1;
- long count = 1;
- bool goingUp = true;
- for (int i = 0; i < 20; i++)
- {
- if (goingUp)
- count = count * (points++ * 2);
- else
- count = count * (long)(points-- * 2);
- if (points == 20)
- goingUp = !goingUp;
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement