fork download
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5. FILE *fp;
  6. fp = fopen("temp.c","w"); /* 產生 temp.c file*/
  7.  
  8. fprintf(fp,"#include <stdio.h>\n");
  9. fprintf(fp,"int main() { \n");
  10. fprintf(fp,"float i; \n");
  11. fprintf(fp,"i=(float)%s ; \n" , argv[1] );
  12. fprintf(fp,"printf(\"%%.4f\", i);}" );
  13. fclose(fp);
  14. //利用系統指令編譯執行後刪除temp檔
  15. system("gcc temp.c -o temp.exe");
  16. system("temp.exe");
  17. system("del temp.c");
  18. system("del temp.exe");
  19. }
Runtime error #stdin #stdout 0s 2180KB
stdin
Standard input is empty
stdout
Standard output is empty