http://ybt.ssoier.cn:8088/problem_show.php?pid=1194
从左下走到右上
转换成 从 左上走到右下
注意最好用 long long 尽管这题没有用到long long
#include<bits/stdc++.h>
using namespace std;
long long a[105][105];
long long m,n;
void print(){
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
cout<<a[i][j]<< " ";
}
cout<<endl;
}
cout<<endl;
}
int main(){
// freopen("cpp.in","r",stdin);
// freopen("cpp.out","w",stdout);
cin>>m>>n;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(i==1||j==1){
a[i][j] = 1;
}else{
a[i][j] = a[i-1][j] + a[i][j-1];
}
}
}
// print();
cout<<a[m][n]<<endl;
return 0;
}