合工大程序设计基础实验报告.docxVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
《程序设计基础》 实验报告 姓名: 学号: 实验一 面向过程的简单程序设计 2. (1) l#include iostream using namespace std; int main () { float x, a, b, c, d, e; cinxabcd; e=x+(a+b)/(c~d); coute?endl; return 0; } 2#includeiostream #includemath. h using namespace std; double daol (double x,double z) { double y; y=l/(x+z); return y; } i nt mai n () { double x, y, a, b; coutz/ In put a number: ,zendl; cinx; a=daol (x,1); b二daol (x, a); y=sqrt(1+b); cout,z表达式的值为:,z?y?endl; return 0; } 3# i ncludeiostream #includemath. h using namespace std; int mainO { double x, y; coutz/ In put a number: ,zendl; cinx; y二cos (x) +sin (x) +1/tan (x); cout,z: y=〃y?endl; return 0; } 〈4# i ncludeiostream #includemath. h using namespace std; int main () I i double x, y, z; coutput two numbers: z,?endl; cinxy; z二exp(x+y)+exp(x-y); cout/zz=: ,?zendl; return 0; } 5 #i nclude〈iostreani #includemath? h using namespace std; int main() { double a, x, y; cout,zInput a number: zz?endl; cin〉x; a二sqrt(1+x*x); y=logl0(l+a); cout/zy=: ,zyendl; return 0; } 6#i nclude〈i ostream using namespace std; int main() { double a, b, y, c; int d; coutz,Input two numbers: /,?endl; cin?a?b; c=a*a-b*b; if(c=0) c=-c; d二a-b; if(a==b) d二0; else if(d=0) d-二1; y=c+d; cout/zy=: ,zyendl; return 0; } 1运行结果:a A Press any key to continue 功能:将人小写字母进行转换 2 输出结果为:0 1,1 0,0 1, 1 1,0 0 功能:用来判断m和n与1000的大小关系 l#includeiostream using namespace std; int main() { int r, 1, s, pi=3. 1415926; coutInput a nmber: ,z?endl; cinr; l=2*pi*r; s=pi*r*r; cout圆的周长为:z,?l?endl; coutz,圆的面积为:〃《s〈endl; return 0; } 2#i nclude〈iostream using namespace std; int main() { int a, b, c, temp; cout,z请输入三个整数:《endl; cinab?c; coutz,交换前:〈a二b=〈b, c=,,c?endl; tomp=a; a二 b; b 二c; c二temp; cout,z交换后:二b=?b〈〈,c=,,?c?endl; return 0; 3 #i nclude〈iostreani using namespace std; int mai n () int a, b, c, d, e; cout?,z请输入任意四位整数:〃〈〈endl; cina; e=a/1000; d=a/100%10; c=a/10%10; b=a%10; coutb?,z,,zc?z/,,zd?,z,,z?e?oncll; return 0; } 3. #includeiostream using namespace std; int main () { double a; int b, c, d, e; cout?,/请输入

文档评论(0)

ggkkppp + 关注
实名认证
文档贡献者

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

1亿VIP精品文档

相关文档