上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: 1 #include 2 #include 3 struct node 4 { 5 int w1,w2,w3;//结构体。 6 } a[5000]; 7 int main() 8 { 9 int n,i,l,max,temp; 10 while(~scanf("%d",&n)) 11 { 12 max=0; 13 ... 阅读全文
posted @ 2019-02-26 10:25 念文丶 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 struct node 4 { 5 int date;//结构体。 6 } a[100]; 7 int main() 8 { 9 int n,cnt; 10 int b,c,d,e,f,g,i,max=0; 11 while(~scanf("%d",&n)) 12 { 13 ... 阅读全文
posted @ 2019-02-26 10:17 念文丶 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 struct node 4 { 5 int data; 6 struct node*next; 7 }; 8 int main() 9 { 10 int n,i; 11 struct node*head,*p,*end,*q; 12 head=(struct node*)malloc(s... 阅读全文
posted @ 2019-02-25 16:34 念文丶 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 struct node 4 { 5 int data; 6 struct node*next; 7 }; 8 int main() 9 { 10 int n,i; 11 struct node*head,*p; 12 head=(struct node*)malloc(sizeof(st... 阅读全文
posted @ 2019-02-25 12:50 念文丶 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 struct node 4 { 5 int data; 6 struct node*next; 7 }; 8 int main() 9 { 10 int n,i; 11 struct node*head,*end,*p; 12 head=(struct node*)malloc(size... 阅读全文
posted @ 2019-02-25 12:47 念文丶 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 char s[100]; 4 int b;//b用来统计输入的字符串遍历到哪里了。 5 struct node 6 { 7 struct node*left,*right; 8 char c;//定义一颗二叉树。 9 }; 10 struct node *creat() 11 { 12 struct ... 阅读全文
posted @ 2019-02-24 18:32 念文丶 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 struct node 5 { 6 int data; 7 }a[100000]; 8 int main() 9 { 10 int n,m; 11 int i,d; 12 memset(a,0,sizeof(a)); 13 scanf("%d %d",&n,&m)... 阅读全文
posted @ 2019-02-21 14:37 念文丶 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 int merge[100000],keep[100000];//merge数组用来寻找记录最终节点的数组,keep用来记录是否存在某个点。 4 int root(int x)//用来寻找最终节点。 5 { 6 while(x!=merge[x]) 7 x=merge[x];//不断地循环,知道找到最终节... 阅读全文
posted @ 2019-02-20 21:20 念文丶 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 int map[1000][1000],visit[1000]; 4 int step,mark; 5 int queue[1000];//用来储存已经遍历了的数据。 6 void BFS(int k) 7 { 8 int i,o=0,p=0,temp,end=0;//temp用来表示当前所在地。o表示下一步从哪个顶点向下出... 阅读全文
posted @ 2019-02-18 14:55 念文丶 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 int map[100][100]; 4 int visit[100]; 5 int k,n;//k在这里定义防止在DFS函数中再次定义使代码繁琐。 6 void DFS(int t)//DFS函数(深度优先搜索)。 7 { 8 int i;//t表示此时我们处于哪个“点”。 9 visit[t]=1;//将数... 阅读全文
posted @ 2019-02-17 20:34 念文丶 阅读(321) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页