- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
强化训练部分解答.doc
PAGE
PAGE 1
强化训练部分解答
/* =========================== */
/* Program Description */
/* Name: 2-1.c */
/* WriteBy:lyx */
/* =========================== */
main()
{
int x,y;
printf(Input x:);
scanf(%d,x);
if(x1)
{y=x;
printf(x=%3d ,y=x=%d\n,x,y);
}
elseif(x10)
{y=2*x-1;
printf(x=%3d ,y=2*x-1=%d\n,x,y);
}
else
{y=3*x-11;
printf(x=%3d, y=3*x-11=%d\n,x,y);
}
}
/* =========================== */
/* Program Description */
/* Name: 2-2.c */
/* WriteBy:lyx */
/* =========================== */
main()
{float score;
char grade;
clrscr();
printf(Please input the score:);
scanf(%f,score);
while(score100||score0)
{printf(\nError!please input again!);
scanf(%f,score);
}
switch((int)(score/10))
{case 10:
case 9 :grade=A;break;
case 8 :grade=B;break;
case 7 :grade=C;break;
case 6 :grade=D;break;
case 5 :
case 4 :
case 3 :
case 2 :
case 1 :
case 0 :grade=E;break;
}
printf(The score is %5.1f,and the grade is %c.\n,score,grade);
}
/* =========================== */
/* Program Description */
/* Name: 2-3.c */
/* WriteBy:lyx */
/* =========================== */
main()
{long int num;
int indiv,ten,hundred,thousand,ten_thousand,place;
clrscr();
printf(please input a number(0-99999):);
scanf(%ld,num);
if(num9999)
place=5;
else if(num999)
place=4;
else if(num99)
place=3;
else if(num9)
place=2;
else place=1;
printf(place=%d\n,place);
printf(every number is :);
ten_thousand=num/10000;
thousand=(int)(num-ten_thousand*10000)/1000;
hundred =(int)(num-ten_thousand*10000-thousand*1000)/100;
ten =(int)(num-ten_thousand*10000-thousand*1000-hundred*100)/10;
indiv =(int)(num-ten_thousand*10000-thousand*1000-hundred*100-ten*10);
switch(place)
{case 5:printf(%d,%d,%d,%d,%d,ten_thousand,thousand,hundred,ten,indiv);
printf(\nreverse number is :);
printf
您可能关注的文档
最近下载
- 35t锅炉课程设计汇本指导附设计程序与CAD总图.doc VIP
- 《铁路路基工程施工质量验收标准》TB-10414-2018全部表格.pdf VIP
- 混凝土地面球场施工方案.docx VIP
- 供应商有害物质管理审核表 .xlsx VIP
- DB37_T 1997.11—2019_物业服务规范第11部分:公共场馆物业.pdf VIP
- 《现代科学技术概论》课程教学大纲(模板).docx VIP
- 热处理工艺学.pdf VIP
- 1999-2023年哈尔滨工业大学高等代数考研真题.pdf VIP
- 一种料理机机座.pdf VIP
- Mg-Al-M合金中Al-M相(M=Sr,Nd)析出行为的热力学分析.pdf VIP
原创力文档


文档评论(0)