Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1.         private long calculate()
  2.         {
  3.             int points = 1;
  4.             long count = 1;
  5.             bool goingUp = true;
  6.             for (int i = 0; i < 20; i++)
  7.             {  
  8.                 if (goingUp)
  9.                     count = count * (points++ * 2);
  10.                 else
  11.                     count = count * (long)(points-- * 2);
  12.                 if (points == 20)
  13.                     goingUp = !goingUp;
  14.             }
  15.             return count;
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement