程序设计基础教程 1.2章 答案.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
程序设计基础教程 1.2章 答案

#includestdio.h int?main?() { P54 第三套 B int?a,b,c; scanf(%d?%d,a,b); a=a^b; b=b^a; a=a^b; ????printf(%d???%d\n,a,b); return?0; } #includestdio.h int?main?() { P55 第三套 C int?a,b; scanf(%d?%d,a,b); a=b-a; b=b-a; a=a+b; ????printf(%d???%d\n,a,b); return?0; } 《程序设计基础教程 C语言版》 上机练习题答案 第一,二套上机 整理人:老林 #includestdio.h const?float?PI=3.14159; int?main() P27 第一套 A { ??int?r; ??double?s; ??scanf(%d,r); ??s=PI*r*r; ??printf(s=%.3f\n,s); ??return?0; } #includestdio.h const?float?PI=3.14159; int?main() P27 第一套 B { ??int?r; ??double?v; ??scanf(%d,r); ??v=4/3.0*PI*r*r*r; ??printf(s=%.5f\n,v); ??return?0; } #includestdio.h const?float?PI=3.14159; int?main() { P28 第一套 C ??int?r,h; ??double?s; ??scanf(%d%d,r,h); ??s=2*PI*r*r+2*PI*r*h; ??printf(s=%.4f\n,s); ??return?0; } #includestdio.h const?float?feet=3.2808; int?main() P28 第二套 A { ??float?h; ??double?High; ??scanf(%f,h); ??High=feet*h; ??printf(High=%.4f\n,High); ??return?0; } #includestdio.h const?float?acre=666.666667; int?main() { P29 第二套 B ??float?h; ??double?square; ??scanf(%f,h); ??square=acre*h; ??printf(square=%.6f\n,square); ??return?0; } #includestdio.h const?float?PI=3.14159; const?int?p=7800; int?main() { P29 第二套 C ??float?r,h; ??double?v,m; ??scanf(%f%f,r,h); ??v=1/3.0*PI*r*r*h; ??m=p*v; ??printf(v=%.6f????m=%.4f??\n,v,m); ?

文档评论(0)

shuwkb + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档