C, 27297/245 = 111.4
소스 코드 (245 바이트)
#include<stdio.h>
main(int c,char**v){char*s;FILE*f=fopen("/tmp/x.c","w");fprintf(f,"#include<stdio.h>\n#include<stdlib.h>\nmain(){int a=%s,b=%s;printf(\"%s * %s = %%d\\n\",a*b);}",v[1],v[2],v[1],v[2]);fclose(f);system("cc -E /tmp/x.c >add.c");}
명령 행에서 두 개의 정수 인수로 컴파일되고 실행될 때, 이는 제품을 계산하는 데 필요한 코드가 포함 된 다른 C 파일을 생성하고 -E플래그로 컴파일합니다 . 이 플래그는 컴파일러가 사전 처리 단계 이후에 중지하고 처리 된 소스 코드 ( stdio.h및 의 전체 내용을 포함 함)를 출력하도록 지정합니다 stdlib.h.
출력 파일 (27297 바이트)
# 1 "/tmp/x.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/tmp/x.c"
# 1 "/usr/include/stdio.h" 1 3 4
# 64 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/_types.h" 1 3 4
# 27 "/usr/include/_types.h" 3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
# 32 "/usr/include/sys/_types.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 33 "/usr/include/sys/_types.h" 2 3 4
********* LINES 13-1273 OMITTED *********
long long
strtoq(const char *, char **, int);
unsigned long long
strtouq(const char *, char **, int);
extern char *suboptarg;
void *valloc(size_t);
# 3 "/tmp/x.c" 2
main(){int a=6,b=7;printf("6 * 7 = %d\n",a*b);}
출력 코드를 실행 한 결과
출력 파일은로 저장되며 add.c컴파일되고 정상적으로 실행될 수 있습니다.
$ ./a.out 6 7
$ cc add.c -o add
$ ./add
6 * 7 = 42
$