全文预览

(中职)C语言程序设计课后习题参考答案(模块2-12)

上传者:叶子黄了 |  格式:pdf  |  页数:27 |  大小:1739KB

文档介绍
NET.\r4.>h?pl@p@p2->next\r\rl.B2.B3.B4.D5.D\r 0DE\r1.>fputc()fputs()>fprintffwrite()?fgetc()fgets()>fscanf()>\rfread()\r2.(Dr?fgetc(fp)@count++Cq->nextDfclose(fp)\r3.>w(2)(ch=getchar())@ch,fp\r= 0@P\rl.#include<stdio.h>\r#include<windows.h>\rmain()\r{FILE*fp;\rcharch;\rintI;\rfp=fopen("d:test.txt","w+");\rwhile((ch=getchar())!=,!/)\r{if(ch>=97&&ch<=122)\rch=ch-32;\rfputc(chjp);EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\r}\rfclose(fp);\rgetch();\r}\r2.#include<stdio.h>\r#include<windows.h>\rmain()\r{FILE*fp;\rcharch;\rintx,i;\rfp=fopen("d:\test.dat","w+");\rfor(i=l;i<=3;i++)\r{scanf("%d0&x);\rfprintf(fp,"%d",x);\r)\rrewind(fp);\rwhile(!feof(fp))\r{ch=fgetc(fp);\rputchar(ch);\r}\rfclose(fp);\rgetch();EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\r)

收藏

分享

举报
下载此文档