#include <stdio.h>
 
int main(int argc, char *argv[])
{
    FILE *fp;
    fp = fopen("temp.c","w");     /* 產生 temp.c file*/
    
	fprintf(fp,"#include <stdio.h>\n");
	fprintf(fp,"int main() { \n");
    fprintf(fp,"float i; \n");
	fprintf(fp,"i=(float)%s ; \n" , argv[1]  );
    fprintf(fp,"printf(\"%%.4f\", i);}" );
    fclose(fp);
//利用系統指令編譯執行後刪除temp檔
	system("gcc temp.c -o temp.exe");
	system("temp.exe");
	system("del temp.c");
	system("del temp.exe");
}