最単純RLE(復号込) #include <stdio.h> /* encode:this.exe e in out / decode:this.exe d in out */ int i=1,p;main(int c,char*v[]){FILE*f=fopen(v[2],"rb"),*o=fopen(v[3],"wb");if( *v[1]=='e'){p=fgetc(f);while((c=fgetc(f))>=0){if(!c-!p&&i<255)i++;else{fwrite( &p,1,1,o);fwrite(&i,1,1,o);p=c;i=1;}}}else while((c=fgetc(f))>=0){if((p=fgetc( f))<0)break;for(i=0;i<p;i++)fwrite(&c,1,1,o);}}