有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。 public class Example20 { public static void main(String[] args) { sum(20); } public static void sum Read More
posted @ 2017-06-04 21:40 本宫在,尔等都是妃 Views(186) Comments(0) Diggs(0) Edit
打印出如下图案(菱形) * *** ****** ******** ****** *** * public class Example19 { public static void main(String[] args) { display(5); } public static void disp Read More
posted @ 2017-06-04 21:39 本宫在,尔等都是妃 Views(142) Comments(0) Diggs(0) Edit
两个乒乓球队进行比赛,各出三人。甲队为a,b,c三人,乙队为x,y,z三人,以抽签决定比赛名单。有人向队员打听比赛的名单:a说他不和x比,c说他不和x、 z比。请编程序找出三队赛手的名单。 public class Example18 { public static void main(String Read More
posted @ 2017-06-04 21:36 本宫在,尔等都是妃 Views(144) Comments(0) Diggs(0) Edit
猴子吃桃问题:猴子第一天摘下若干个桃子,当即吃了一半,还不过瘾,又多吃了一个;第二天早上又将剩下的桃子吃掉一半,而且又多吃了一个。以后每天早上都吃了前一天剩下的一半零一个。到第10天早上想再吃时,就只剩下一个桃子了。求第一天共摘了多少个桃子。 public class Example17 { pub Read More
posted @ 2017-06-04 21:33 本宫在,尔等都是妃 Views(381) Comments(2) Diggs(0) Edit
输出九九乘法表。 public class Example16 { public static void main(String[] args) { table(9); } public static void table(int n) { for (int i = 1; i <= n; i++) Read More
posted @ 2017-06-04 21:31 本宫在,尔等都是妃 Views(245) Comments(0) Diggs(0) Edit