摘要: 1 #include <stdio.h> 2 3 /* count lines in input */ 4 int 5 main() 6 { 7 int c, pc; /* c = character, pc = previous character */ 8 9 /* set pc to a value that wouldn't match any character, in case10 this program is ever modified to get rid of multiples of other11 ... 阅读全文
posted @ 2013-05-02 15:31 Levi.duan 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <string.h> 3 #define MAX 1000 4 5 int p[MAX]; 6 int rank[MAX]; 7 void init(int n){ 8 int i; 9 // memset(rank, 0, sizeof(rank));10 for(i=1;i<n;i++) {p[i]=i;rank[i]=0;}11 }12 13 14 int find_root_digui(int x){15 if(x!=p[x])16 return p[x]=find_roo... 阅读全文
posted @ 2013-05-02 10:34 Levi.duan 阅读(198) 评论(0) 推荐(0) 编辑