vector用法

时间:2021-04-07 11:33:01   收藏:0   阅读:0

#include<bits/stdc++.h>
using namespace std;
int maze [5][5] = {
0, 1, 0, 0, 0,
0, 1, 0, 1, 0,
0, 0, 0, 0, 0,
0, 1, 1, 1, 0,
0, 0, 0, 1, 0,
};
typedef struct
{int x;int y;}Point;
int dir[4][2]={0,1,0,-1,1,0,-1,0};
vector<Point> path;
vector<Point>::iterator it;

int main()
{
Point p1,p2;
p1.x=3;p1.y=5;
p2.x=1;p2.y=1;
path.push_back(p1);path.push_back(p2);
for (it=path.begin() ; it != path.end(); ++it)
{
cout<<it->x<<‘\t‘<<it->y<<endl;
}
}

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!