#include
using namespace std;
int main()
{
int arr[50][50] = { 0 };
arr[0][1]=1;
cout << "please input the maxrow: ";
int maxrow = 0;
cin >> maxrow;
cout << "please input the maxcol: ";
int maxcol = 0;
cin >> maxcol;
cout << "please input a flaot of x thar you want: ";
int x = 0;
int y = 0;
cin >> x;
cout << "please input a flaot of y thar you want: ";
cin >> y;
for (int i = 1; i <= maxrow; i++)
{
for (int j = 1; j <= maxcol; j++)
{
if (i == x && j == y)
{
continue;
}
arr[i][j] = arr[i - 1][j] + arr[i][j - 1];
}
}
printf("%d\n", arr[maxrow][maxcol]);
return 0;
}
1225

被折叠的 条评论
为什么被折叠?



