#include <stdio.h>
void main()
{
FILE *fp;
unsigned int map_id;
char file_name[500];
printf("Please input the ID of the map: \n");
scanf("%d", &map_id);
if (map_id > 999)
map_id = 999;
sprintf(file_name, "Map%03d.rxdata", map_id);
printf("The file name is \"%s\".\n", file_name);
fp = fopen(file_name, "ab");
fwrite(&map_id, sizeof(map_id), 1, fp);
fclose(fp);
printf("File created and written.\n");
}