ZIP indir
0
main
1 dal
git@carbon4code.com:ahmet/dr-quine.git
Ahmet Kerem Sezgin Make filelar tamam
11 commit
dr-quine C Sully.c
Sully.c 1.0 KB
int i = 5;
#include <stdio.h>
#include <stdlib.h>
char *s = "int i = %d;%c#include <stdio.h>%c#include <stdlib.h>%cchar *s = %c%s%c;%cint main() {%c    if (i <= 0) return 0;%c    int x = i - 1;%c    char n[32], c[128];%c    sprintf(n, %cSully_%%d.c%c, x);%c    FILE *f = fopen(n, %cw%c);%c    if (f) {%c        fprintf(f, s, x, 10, 10, 10, 34, s, 34, 10, 10, 10, 10, 10, 34, 34, 10, 34, 34, 10, 10, 10, 10, 34, 34, 10, 10, 10, 10, 10);%c        fclose(f);%c        sprintf(c, %cgcc -Wall -Wextra -Werror %%s -o Sully_%%d && ./Sully_%%d%c, n, x, x);%c        system(c);%c    }%c    return 0;%c}%c";
int main() {
    if (i <= 0) return 0;
    int x = i - 1;
    char n[32], c[128];
    sprintf(n, "Sully_%d.c", x);
    FILE *f = fopen(n, "w");
    if (f) {
        fprintf(f, s, x, 10, 10, 10, 34, s, 34, 10, 10, 10, 10, 10, 34, 34, 10, 34, 34, 10, 10, 10, 10, 34, 34, 10, 10, 10, 10, 10);
        fclose(f);
        sprintf(c, "gcc -Wall -Wextra -Werror %s -o Sully_%d && ./Sully_%d", n, x, x);
        system(c);
    }
    return 0;
}