2019獨角獸企業重金招聘Python工程師標準>>>
#include?<stdio.h>
#include?<stdlib.h>int?main(){FILE?*fp;char?ch;if((fp=fopen("testfile",?"a"))?==?NULL){fprintf(stderr,?"Error?opening?file.\n",fp);exit(1);}printf("Input?a?string?(Ctrl+D?to?exit):\n");while((ch=getchar())?!=?EOF){fputc(ch,?fp);}if(ferror(fp)){puts("something?wrong?to?read?file\n");}else{puts("write?file?success!\n");}fclose(fp);printf("\n");return?0;
}