#include#include #include #include void main(){ int i,j,k,m; int width,height,start,world; int *bmp,*Lcount; bool *Lflag; FILE *fp; if((fp=fopen("in1.bmp","rb"))==NULL){ printf("文件打开失败"); return; } fseek(fp,10L,0); fscanf(fp,"%4c",&start); // 4c表示该数据占4个字节// printf("start = %d\n",start); fseek(fp,18,0); fscanf(fp,"%4c",&width);// printf("width = %d\n",width); fseek(fp,22,0); fscanf(fp,"%4c",&height); // printf("height = %d\n",height); bmp = (int*)malloc((width+2)*sizeof(int)); memset(bmp,0,(width+2)*sizeof(int)); Lcount = (int*)malloc(width*sizeof(int)); memset(Lcount,0,width*sizeof(int)); Lflag = (bool*)malloc(width*sizeof(bool)); memset(Lflag,0,width*sizeof(bool)); Lcount--; Lflag--; fseek(fp,start,0); world = ( width%32 ? width/32+1 : width/32 )*4; int last,i1,i2,i3; int eCount = 0 ; for(i=0 ; i = 0 && k<=width ; m-- ){ if( !( 1<