![](https://i-blog.csdnimg.cn/direct/974c37ac8fa048df88619f70da0a3e40.png)
![](https://i-blog.csdnimg.cn/direct/d58e07a965834b9a9a22fe832292729c.png)
#include<myhead.h>
int main(int argc, const char *argv[])
{
printf("__-__-__-__");
printf("\b\b\b\b\b\b\b\b\b\b\b");
fflush(stdout);
int time = 0;
while(1)
{
sleep(1);
time++;
if(time==8)
{
printf("%d",time);
break;
}
if(time%2==0)
{
printf("%d-",time);
}
else
printf("%d",time);
fflush(stdout);
}
return 0;
}
![](https://i-blog.csdnimg.cn/direct/99f222cdb6c548a092186f771e99dbef.png)
#include<myhead.h>
int main(int argc, const char *argv[])
{
FILE* rfp = fopen("1.bmp","r+");
if(rfp==NULL)
{
perror("rfp fopen");
return -1;
}
int size = 0;
fseek(rfp,2,SEEK_SET);
fread(&size,4,1,rfp);
printf("size = %d\n",size);
int res_heigth = 0,res_width = 0;
fseek(rfp,18,SEEK_SET);
fread(&res_width,4,1,rfp);
fseek(rfp,22,SEEK_SET);
fread(&res_heigth,4,1,rfp);
printf("res_width = %d res_heigth = %d\n",res_width,res_heigth);
int width = res_width*2;
int heigth = res_heigth*2;
size = width*heigth+54;
fseek(rfp,2,SEEK_SET);
fwrite(&size,4,1,rfp);
fseek(rfp,22,SEEK_SET);
fwrite(&heigth,4,1,rfp);
fseek(rfp,18,SEEK_SET);
fwrite(&width,4,1,rfp);
unsigned black[3] = {0,0,0};
fseek(rfp,54,SEEK_SET);
for(int i = 0;i<width;i++)
{
for(int j = 0;j<heigth;j++)
{
// fwrite(black,3,1,rfp);
}
}
return 0;
}
![](https://i-blog.csdnimg.cn/direct/3f89bd6ce1b9477694bfcdc833201090.png)