15 Lattice Paths

#include <iostream>
#include <limits>
#include <vector>
using namespace std;
void pause() { cin.ignore(numeric_limits<streamsize>::max(), '\n'); }
#define GRID 20
int main()
{
long long int combinations = 1;
for (int i = 0; i < GRID; i++)
{
combinations *= 2 * GRID - i;
combinations /= i + 1;
}
cout << combinations;
pause();
}Last updated