#include #include #include //#include //#include int XStarting, XFinish, XStep, YStarting, YFinish, YStep; const char tmpjpgfile[]="tmp.jpg"; const char _tmpjpgfile[]="_tmp.jpg"; void main(int argc, char**argv) { int t1,t2,t3; int counter=0; while (scanf("%d %d %d",&t1,&t2,&t3)==3) { counter++; if (t3<1000000 && t3>0) { int XCounter,YCounter; char FileName[1024]; char TargetFileNamePPM[1024]; char DirName[1028]; char TargetFileNameJPG[1024]; char Str[1256]; sprintf(FileName,"%d_%d.jpg",t1,t2); sprintf(TargetFileNamePPM,"%d%d.ppm",t1,t2); sprintf(TargetFileNameJPG,"%d%d.jpg",t1,t2); strcpy(DirName,FileName); DirName[0]='0'; DirName[3]='\x00'; strcpy(Str,"djpeg.exe "); strcat(Str,DirName); strcat(Str,"\\"); strcat(Str,FileName); strcat(Str," "); strcat(Str,DirName); strcat(Str,"\\"); strcat(Str,TargetFileNamePPM); // printf("%s\n",Str); system(Str); strcpy(Str,"cjpeg.exe -grayscale -optimize -quality 24 "); strcat(Str,DirName); strcat(Str,"\\"); strcat(Str,TargetFileNamePPM); strcat(Str," "); strcat(Str,DirName); strcat(Str,"\\"); strcat(Str,TargetFileNameJPG); // printf("%s\n",Str); system(Str); strcpy(Str,"del "); strcat(Str,DirName); strcat(Str,"\\"); strcat(Str,TargetFileNamePPM); system(Str); } } }