//盡可能少的改程序使得運行結果產生一個含10個welcome to\n字符串的temp.txt文件#include<stdio.h>#include<string.h>int main(int argc,char*argv[]){ int i=0; FILE *fp=fopen("temp.txt","w+"); char string[]="WELCOME TO \n"; char secondstring[]="welcome to\n"; char temp[sizeof(string)]; for(i=0;i<10;i++) ? fputs(string,fp);? ? fseek(fp,0,SEEK_SET);? ? while((fgets(temp,sizeof(string),fp))!=NULL)? ? {? ? fseek(fp,-(long)sizeof(temp),1);? ? fputs(secondstring,fp); } fclose(fp); return 0; ??}?
- 0 回答
- 0 關注
- 1584 瀏覽
添加回答
舉報
0/150
提交
取消