home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker Chronicles 2
/
HACKER2.BIN
/
117.USMAP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1984-05-18
|
856b
|
36 lines
/*
** DeSmet C Program for Copying U.S. Map Data
** - insert your own editing functions
*/
#include "stdio.h"
main()
{
FILE input, output;
float lon[4], lat[4];
int state, points, i;
input = fopen("usmap.dat", "r");
output = fopen("usmap.new", "w");
while(1) {
fscanf(input, "%d %d", &state, &points);
fprintf(output, "%4d %4d\n", state, points);
printf("%4d %4d\n", state, points);
for (i = 0; i < points; i += 4) {
fscanf(input, "%f %f %f %f %f %f %f %f",
&lon[0], &lat[0], &lon[1], &lat[1], &lon[2], &lat[2], &lon[3], &lat[3]);
fprintf(output, "%9.4f %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f\n",
lon[0], lat[0], lon[1], lat[1], lon[2], lat[2], lon[3], lat[3]);
}
if(state == 56) {
fclose(output);
exit();
}
}
}