2022年C程序设计第九章课后答案.docx

上传人:C****o 文档编号:49992334 上传时间:2022-10-12 格式:DOCX 页数:8 大小:38.09KB
返回 下载 相关 举报
2022年C程序设计第九章课后答案.docx_第1页
第1页 / 共8页
2022年C程序设计第九章课后答案.docx_第2页
第2页 / 共8页
点击查看更多>>
资源描述

《2022年C程序设计第九章课后答案.docx》由会员分享,可在线阅读,更多相关《2022年C程序设计第九章课后答案.docx(8页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、名师归纳总结 精品学习资料 - - - - - - - - - - - - - - -学而不思就惘,思而不学就殆C程序设计谭浩强第九章课后答案1 #include struct Days int year; int month; int day; ; int main int mds12=31,28,31,30,31,30,31,31,30,31,30,31,i,d; struct Days a; printf 请输入年、月、日 n; scanf%d,%d,%d,&a.year,&a.month,&a.day; d=a.day; fori=0;i2 d+; printf%d 月%d 日是 %d

2、 年的第 %d 天n,a.month,a.day,a.year,d; return 0; 2 #include struct Days int year; int month; int day; ; int main int daysstruct Days a; struct Days a; printf 请输入年、月、日 n; scanf%d,%d,%d,&a.year,&a.month,&a.day; printf%d 月%d 日是 %d 年的第 %d 天n,a.month,a.day,a.year,daysa; return 0; int daysstruct Days a int md

3、s12=31,28,31,30,31,30,31,31,30,31,30,31,i,d; 细心整理归纳 精选学习资料 - - - - - - - - - - - - - - - 第 1 页,共 4 页 - - - - - - - - - 名师归纳总结 精品学习资料 - - - - - - - - - - - - - - -学而不思就惘,思而不学就殆d=a.day; fori=0;i2 d+; return d; 3 #include struct Student int num; char name20; int score3; ; int main void printstruct Stud

4、ent a; struct Student a5; int i,j; printf 请依次输入 5 名同学的学号 :n; fori=0;i5;i+ scanf%d,&ai.num; printf 请依次输入 5 名同学的姓名 :n; fori=0;i5;i+ scanf%s,ai.name; printf 请依次输入 5 名同学的成果 :n; fori=0;i5;i+ forj=0;j3;j+ scanf%d,&ai.scorej; printa; return 0; void printstruct Student a struct Student *p=a; printf 学号 姓名语文数

5、学 英语 n; for;pnum,p-name,p-score0,p-score1,p-score2 ; 4 细心整理归纳 精选学习资料 - - - - - - - - - - - - - - - 第 2 页,共 4 页 - - - - - - - - - 名师归纳总结 精品学习资料 - - - - - - - - - - - - - - -学而不思就惘,思而不学就殆#include struct Student int num; char name20; int score3; ; int main void printstruct Student a; void inputstruct S

6、tudent a; struct Student a5; inputa; printa; return 0; void inputstruct Student a int i,j; printf 请依次输入 5 名同学的学号 :n; fori=0;i5;i+ scanf%d,&ai.num; printf 请依次输入 5 名同学的姓名 :n; fori=0;i5;i+ scanf%s,ai.name; printf 请依次输入 5 名同学的成果 :n; fori=0;i5;i+ forj=0;j3;j+ scanf%d,&ai.scorej; void printstruct Student

7、a struct Student *p=a; printf 学号 姓名语文数学 英语 n; for;pnum,p-name,p-score0,p-score1,p-score2 ; #include struct Student 细心整理归纳 精选学习资料 - - - - - - - - - - - - - - - 第 3 页,共 4 页 - - - - - - - - - 名师归纳总结 精品学习资料 - - - - - - - - - - - - - - -学而不思就惘,思而不学就殆int num; char name20; int score3; ; int main void print

8、struct Student a; void inputstruct Student a; struct Student a10; inputa; printa; return 0; void inputstruct Student a int i,j; printf 请依次输入 10 名同学的学号 :n; fori=0;i10;i+ scanf%d,&ai.num; printf 请依次输入 10 名同学的姓名 :n; fori=0;i10;i+ scanf%s,ai.name; printf 请依次输入 10 名同学的成果 :n; fori=0;i10;i+ forj=0;jnum,p-name,p-score0,p-score1,p-scor e2,av; 细心整理归纳 精选学习资料 - - - - - - - - - - - - - - - 第 4 页,共 4 页 - - - - - - - - -

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁