摘要:
*售票员 *新的《复仇者》电影刚刚上映!电影院售票处有很多人排起了长队。他们每人有一张100、50或25美元的钞票(每人只有一张纸币)。一张“复仇者”的票要25美元。 *瓦西娅目前是一名职员。他想把票卖给这一行的每一个人。 *如果瓦西娅一开始没有钱,而且严格按照人们排队的顺序售票,他能不能给每个人一 阅读全文
posted @ 2020-06-23 17:39
BORS
阅读(287)
评论(0)
推荐(0)
摘要:
* 通过列出前六个质数:2,3,5,7,11和13,我们可以看到第六个质数是13。* * (输出第n个质数)第10001个质数是什么? public static int findPrime(int n) { int prime = 2, i = 1; while (true) { i++; if 阅读全文
posted @ 2020-06-23 17:23
BORS
阅读(337)
评论(0)
推荐(0)
摘要:
已知:* The sum of the squares of the first ten natural numbers is, * 1^2+2^2+...+10^2=385 * The square of the sum of the first ten natural numbers is, * 阅读全文
posted @ 2020-06-23 17:21
BORS
阅读(291)
评论(0)
推荐(0)
摘要:
已知:2520是可以被1到10中的每一个数除而没有任何余数的最小数。求:能被1到20之间的所有数字整除的最小正数是多少? 232792560 public static int getMinPositiveNum(int in_num) { for (int n = in_num; ; n++) { 阅读全文
posted @ 2020-06-23 17:16
BORS
阅读(567)
评论(0)
推荐(0)
摘要:
给出:斐波那契数列:1、1、2、3、5、8、13、21、34...输入几(n),输出对应位上的数值 public static int feibonaqie2(int n) { int n1 = 1; int n2 = 1; int n3 = 2; if (n <= 0) { return 0; } 阅读全文
posted @ 2020-06-23 17:13
BORS
阅读(178)
评论(0)
推荐(0)

浙公网安备 33010602011771号