PATHS

You are given an N x M size grid where N is the number of rows and M is the number of columns. Your task is to calculate in how many ways you can go from the upper-left corner to the bottom-right corner if you can only move down and to the right.

Input:

The input consists of two space-separated integers N and M (1 ≤ N, M ≤ 30).

Output:

Print out one integer - the answer to the given problem.

Examples:
Input: 1 1
Output: 2
Input: 4 4
Output: 70

CAN SOMEONE HELP ME WITH THIS TASK?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
#include <sstream>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
    string line;
    getline(cin, line);
    stringstream ss;
    ss.str(line);
    vector<int> numbers;
    int x;
    while (ss >> x) numbers.push_back(x);
	// Your code goes here
	int result = 0;
	cout << result;
	return 0;
}
Last edited on
This is the third instance of the same question. Please do not do that.

Close this down with a green tick and refer to the one that has been answered at
http://www.cplusplus.com/forum/general/237160/#msg1059950
Last edited on
Topic archived. No new replies allowed.