Wednesday, 29 January 2014

C for Coglione



Oggi ritorno a perdere tempo e scrivo la bomba dell'anno:


#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int main ()
{
FILE *data;
data = fopen("data.c", "w");
char form[100];

printf("insert function\n");
scanf("%s", form);

fprintf (data, "#include <stdio.h>\n#include <stdlib.h>\n#include <math.h>\nint main ()\n{\n double x, y;\n y=%s;\nprintf(\"%s=%%lf\\n\", y);\n return 0;\n}\n", form, form);
fclose (data);
system("export gccpath=\"$(which gcc)\" && $gccpath data.c -lm && ./a.out");
//system("gcc data.c -lm && ./a.out");
return 0;
}

No comments:

Post a Comment