#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) { int XCounter,YCounter; for (XCounter=t1-4;XCounter<=t1+5;XCounter++) { for (YCounter=t2-4;YCounter<=t2+5;YCounter++) { char FileName[1024]; char Str[1256]; int OK=0; sprintf(FileName,"%d_%d.jpg",XCounter,YCounter); sprintf(Str,"lynx -dump \"http://terraServer.microsoft.com/GetImageXY.asp?XId=%d&YId=%d&SrcId=1&ImgSize=1\" > %s",XCounter,YCounter,FileName);//tmpjpgfile); system(Str); sprintf(Str,"cmp %s %s > _tmp", FileName//tmpjpgfile ,_tmpjpgfile); if (system(Str)) { OK=1; int filesize; FILE *fileptr; if (fileptr=fopen(FileName//tmpjpgfile ,"rb"),fileptr==NULL) { filesize=-1; } else { if (fseek(fileptr,0L,SEEK_END)) { filesize=-1; } else filesize=ftell(fileptr); fclose(fileptr); } if (filesize>0) OK=filesize; else OK=0; } else { sprintf(Str,"rm %s",FileName); system(Str); OK=-1; } printf("%d %d %d\n",XCounter,YCounter,OK); } } } } }