谁能写个C++程序给我啊

来源:百度知道 编辑:UC知道 时间:2024/06/23 13:28:29
我想交个作业,什么内容都行
邮箱hj.zh@163.com

#include<iostream>
using namespace std;
struct queuenode
{
int x;
int y;
queuenode *next;
}*head,*tale;
void enqueue(int xx,int yy)
{
queuenode *t;
t=new queuenode;
t->x=xx;t->y=yy;
t->next=NULL;
if(tale)
{
tale->next=t;
tale=t;
}
else tale=head=t;
}
void exqueue(int &xx,int &yy)
{
queuenode *t;
xx=head->x;yy=head->y;
t=head;
if(head==tale)tale=NULL;
head=head->next;
delete t;
}
int main()
{
int a[310][310],b[310][310];
char map[310][310];
int i,j,n,m,tx,ty,sx,sy,x,y,min,ttx,tty;
while(1)
{
cin>>n>>m;
if(n==0)return 0;
for(i=0;i<n;i++)
for(j=0;j<m;j++)
{
cin>>map[i