为了账号安全,请及时绑定邮箱和手机立即绑定

求助求助,怎么改

求助求助,怎么改

C C#
才下眉头却上我心头 2016-05-07 09:58:35
//尽可能少的改程序使得运行结果产生一个含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 关注
  • 1508 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信