怎么做下去
  • 板块灌水区
  • 楼主_晓风残月_
  • 当前回复21
  • 已保存回复21
  • 发布时间2020/7/16 14:18
  • 上次更新2023/11/6 23:01:55
查看原帖
怎么做下去
311921
_晓风残月_楼主2020/7/16 14:18

题目链接

求大佬完善此代码

#include<bits/stdc++.h>
using namespace std;
int m,n,t,ans,i,j;
int dx[4]={1,0,-1,0},x1,x2;
int dy[4]={0,0,-1,1},y1,y2;
char Map[101][101];
bool vis[101][101];
void dfs(int x,int y,int cnt,int s)
{
	if(x<1||x>m||y<1||y>n)
	{
		return;
	}
	if()
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.precision(10);
	cout<<fixed;
	cin>>m>>n>>t;
	for(i=1;i<=m;i++)
	{
		for(j=1;j<=n;j++)
		{
			cin>>Map[i][j];
			if(Map[i][j]=='@')
			{
				x1=i;
				y1=j;
			}
			else if(Map[i][j]=='+')
			{
				x2=i;
				y2=j;
			}
		}
	}
	dfs(x,y,t,0);
	cout<<ans<<"\n";
	return 0;
}
2020/7/16 14:18
加载中...