请问这个代码哪里错了?
查看原帖
请问这个代码哪里错了?
1618475
Saberzhang楼主2025/1/17 23:42
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,t[21][21]={-1};
	cin>>a>>b>>c>>d;
	t[c-1][d-2]=t[c-2][d-1]=t[c+1][d-2]=t[c+2][d-1]=0;
	t[c-1][d+2]=t[c-2][d+1]=t[c+1][d+2]=t[c+2][d+1]=0;
	t[c][d]=0;
	for(int i=0;i<=a;i++)
		for(int j=0;j<=b;j++){
			if(t[i][j]!=0){
				if(i==0||j==0){
					t[i][j]=1;
				}
				else
					t[i][j]=t[i-1][j]+t[i][j-1];
			}
		}
	cout<<t[a][b];
	return 0;
}
2025/1/17 23:42
加载中...