#include #include void main(int argc, char *argv[]) { FILE* fp; int N = 0; if (argc < 2) return; if ((fp = fopen(argv[0], "r")) == NULL) return; for(;;) { int get = fgetc(fp); if (get == EOF) break; else if (get == '-') N *= -1; else N = N*10+(get-'0'); } fclose(fp); if ((fp = fopen(argv[1], "w")) == NULL) return; fprintf(fp, "0 %d\n", N); fclose(fp); }