- 1、本文档共7页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
java程序员算法锻炼(Java programmer algorithm exercise)
java程序员算法锻炼(Java programmer algorithm exercise)
This article is contributed by buaadu
Pdf documents may experience poor browsing on the WAP side. It is recommended that you first select TXT, or download the source file to the local view.
[program 1] title: classical problem: a pair of rabbits from birth to third months after each month of birth to a pair of rabbits, a small rabbit to third months after the month gave birth to a pair of rabbits, if the rabbit will die, asked the rabbit is the total number of each month? 1. program analysis:? Number of rabbits 1,1,2,3,5,8,13,21...... [2] program topic: determine how many primes between 101-200, and the output of all prime numbers. The 1. program analysis: the judgment method of prime numbers: were removed 2 to sqrt with a number (the number), if divisible, it indicates that this number is not prime, and [3]. The program is a prime topic: print out all of the narcissus number, the so-called daffodils refers to a three digit, the all digital cube and equal to the number itself. For example: 153 is a daffodils, because three times three times three times 153=1 +5 +3. 1. program analysis: Using the for cycle to control the number of 100-999, each decomposition of a single digit number, ten, 100. [4] program title: a positive integer factorization. For example: input 90, 90=2*3*3*5. analysis on N: print out the decomposition of the quality factor, should first find a minimal prime number k, then complete the following steps: (1) 如果这个质数恰等于n,则说明分解质因数的过程已经结束,打印出即可. (2)如果n k,但n能被k整除,则应打印出k的值,并用n除以k的商,作为新的正整数你n,重 复执行第一步. (3)如果n不能被k整除,则用k+1作为k的值,重复执行第一步. 【程序5】 题目:利用条件运算符的嵌套来完成此题:学习成绩 =90分的同学用A表示,60-89分之间的 用B表示,60分以下的用C表示. 1.程序分析:(a b)?a:b这是条件运算符的基本例子. 【程序6】 题目:输入两个正整数m和n,求其最大公约数和最小公倍数. 1.程序分析:利用辗除法. 【程序7】 题目:输入一行字符,分别统计出其中英文字母,空格,数字和其它字符的个 1.. Program analysis: use while statement, the condition for the input character is not\n [program 8] title: s=a+aa+aaa+aaaa+aa...... The value of a, where a is a number. For example, 2+22+22
您可能关注的文档
- 03.3.牛顿第二定律(03.3. Newton's second law).doc
- ++兰州大学风雨百年发展历程_卫视_凤凰网2().doc
- 007_黄仁宇现象(007_ Huang Renyu phenomenon).doc
- 002机械挖土施工工艺(002 mechanical excavation construction technology).doc
- 007如何创建html表格(007 how to create a HTML table).doc
- 008_盼(008_ look forward to).doc
- 0.5元(0.5 yuan).doc
- 033牛顿第二定律(033 Newton's second law).doc
- 002汽车美容店投资创业方案(002 auto beauty shop investment venture program).doc
- 04 配套cad笔记(04 matching CAD notes).doc
- 《管式微通道反应器》标准征求意见稿.docx
- 《红曲米醋》征求意见稿.pdf
- 2024年至2025年浙江省宁波市公开招聘警务辅助人员辅警结构化面试能力提升题库二含答案.docx
- 2022年至2023年海南省海口市公开招聘警务辅助人员辅警结构化面试历年模拟题库二含答案.docx
- 企业基层党支部建设标准化工作实施方案.docx
- 2025 铸牢中华民族共同体意识交流发言【5篇精选】供参考.docx
- 2024-2025学年下学期高中语文人教部编版高二期末必刷常考题之文学类文本阅读.docx
- 2024-2025学年下学期高中语文人教部编版高一期末必刷常考题之实用类文本阅读.docx
- 2024-2025学年下学期高中语文人教部编版高二期末必刷常考题之古诗词赏析.docx
- 2024-2025学年下学期高中语文人教部编版高一期末必刷常考题之论述类文本阅读.docx
文档评论(0)