全输出0
#include<bits/stdc++.h>
using namespace std;
long long n,m,x,y,a[210][210],v[210][210];
int main()
{
cin>>n>>m>>x>>y;
if(x-2>=0&&y-1>=0) v[x-2][y-1]=1;
if(x-2>=0) v[x-2][y+1]=1;
if(x-1>=0&&y-2>=0) v[x-1][y-2]=1;
if(x-1>=0) v[x-1][y+2]=1;
if(y-2>=0) v[x+1][y-2]=1;
v[x+1][y+2]=1;
if(y-1>=0) v[x+2][y-1]=1;
v[x+2][y+1]=1;
v[x][y]=1;
for(int i=0;i<=n;i++)
{
for(int j=0;j<=m;j++)
{
if(v[i][j]==1)
{
a[i][j]=0;
continue;
}
if((i==0&&a[i][j-1]!=0)||(j==0&&a[i-1][j]!=0))
{
a[i][j]=1;
continue;
}
if(i==0||j==0) continue;
a[i][j]=a[i-1][j]+a[i][j-1];
}
}
cout<<a[n][m];
return 0;
}
自测无问题,为什么交上去全是0?