实验6 C++课后答案.pdf_第1页
实验6 C++课后答案.pdf_第2页
实验6 C++课后答案.pdf_第3页
实验6 C++课后答案.pdf_第4页
实验6 C++课后答案.pdf_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

课后答案网 用心为你服务 大学答案 中学答案 考研答案 考试答案 最全最多的课后习题参考答案 尽在课后答案网 Khdaw团队一直秉承用心为大家服务的宗旨 以关注学生的学习生活为出发点 旨在为广大学生朋友的自主学习提供一个分享和交流的平台 爱校园 课后答案网 淘答案 实验 6 函数 1 include iostream h bool isprime int m for int i 2 m i 0 i return i m void main int m count 0 for m 3 m 1000 m m 2 if isprime m 2 include iostream h int reverse int x int n 0 while x 0 n n 10 x 10 x x 10 return n void main int i 10000 count 0 while count 10 if i reverse i cout i endl count i w w w k h d a w c o m 课后答案网 3 include iostream h include stdio h int palindrome char s char p s q s int f 1 假设是回文字符串 while p 0 p p while q p if q p p q else f 0 break return f void main char s 100 gets s if palindrome s cout 是回文字符串 endl else cout 不是回文字符串 endl 4 1 include iostream h int fun int s int n int x int i j k t int m 0 优秀人数 for i 0 i n 1 i k i for j i 1 js k k j t s i s i s k s k t for i 0 i 90 m if s i 60 x w w w k h d a w c o m 课后答案网 return m void main int a 10 i t 0 t 表示不及格人数 for i 0 i a i cout 优秀人数 fun a 10 cout 不及格人数 t endl cout 排序后 endl for i 0 i 10 i cout a i 2 include iostream h void fun int s int n int for i 0 i n 1 i k i for j i 1 js k k j t s i s i s k s k t for i 0 i 90 x if s i 60 y void main int a 10 i m 0 t 0 m t 分别表示优秀人数和不及格人数 for i 0 i a i fun a 10 m t cout 优秀人数 m endl cout 不及格人数 t endl cout 排序后 endl for i 0 i 10 i cout a i A p j q for j 0 jmax chmax j A max p j void main char s 1000 c chmax int a 26 0 j max 0 gets s freq s a chmax max for j 0 j 26 j if a j c j A cout c a j endl cout 频率出现最高的字母 chmax max m w w w k h d a w c o m 课后答案网 m p p return m void main char s 1000 p gets s p max s while p 0 if p a i i 2 p p x x m m i 1 i t p m return s void main double x cin x cout fun x 1e 5 a1 b1 a2 b2 cin c1 d1 c2 d2 cout a1 b1 a2 b2 dist a1 b1 a2 b2 endl cout c1 d1 c2 d2 dist c1 d1 c2 d2 endl 2 include iostream h include math h template double dist T x1 T y1 T x2 T y2 double s s sqrt x1 x2 x1 x2 y1 y2 y1 y2 return s void main int a1 b1 a2 b2 double c1 d1 c2 d2 cin a1 b1 a2 b2 cin c1 d1 c2 d2 co

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论