有一分数序列: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(197)
Comments(0)
Diggs(0)
        
            
        
        
        
打印出如下图案(菱形) * *** ****** ******** ****** *** * public class Example19 { public static void main(String[] args) { display(5); } public static void disp    Read More
posted @ 2017-06-04 21:39
本宫在,尔等都是妃
Views(148)
Comments(0)
Diggs(0)
        
            
        
        
        
两个乒乓球队进行比赛,各出三人。甲队为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(152)
Comments(0)
Diggs(0)
        
            
        
        
        
猴子吃桃问题:猴子第一天摘下若干个桃子,当即吃了一半,还不过瘾,又多吃了一个;第二天早上又将剩下的桃子吃掉一半,而且又多吃了一个。以后每天早上都吃了前一天剩下的一半零一个。到第10天早上想再吃时,就只剩下一个桃子了。求第一天共摘了多少个桃子。 public class Example17 { pub    Read More
posted @ 2017-06-04 21:33
本宫在,尔等都是妃
Views(393)
Comments(2)
Diggs(0)
        
            
        
        
        
输出九九乘法表。 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(247)
Comments(0)
Diggs(0)
        
 
                    
                     
                    
                 
                    
                
 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号