欢迎访问我的个人网站==》 jiashubing.cn
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 39 下一页
摘要: Digital RootsProblem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the process is repeated. 阅读全文
posted @ 2014-03-24 18:08 贾树丙 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Super Jumping! Jumping! Jumping!Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game can be played by two or more than two players. It consi 阅读全文
posted @ 2014-03-24 18:05 贾树丙 阅读(335) 评论(0) 推荐(0) 编辑
摘要: Common SubsequenceProblem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a strictly increasing sequence of indices of X such that for all j = 1,2,...,k,... 阅读全文
posted @ 2014-03-24 18:00 贾树丙 阅读(298) 评论(0) 推荐(0) 编辑
摘要: Monkey and BananaProblem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monkey is clever enough, it shall be able to reach the banana by pla 阅读全文
posted @ 2014-03-24 17:56 贾树丙 阅读(621) 评论(0) 推荐(0) 编辑
摘要: Humble NumberProblem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers.Write a program to find and print the nth element in this sequenceInpu 阅读全文
posted @ 2014-03-24 17:49 贾树丙 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 效果图如下: CMain函数: 1 package com.shubing.main; 2 3 public class CMain 4 { 5 public static void main(String[] args) 6 { 7 MainFrame mainFrame = new MainFr 阅读全文
posted @ 2014-03-16 21:00 贾树丙 阅读(1295) 评论(0) 推荐(0) 编辑
摘要: ClockTime Limit:2 Seconds Memory Limit:65536 KBYou are given a standard 12-hour clock with analog display, an hour hand and a minute hand. How many times does the minute hand pass the hour hand in a given time interval?Sample Input12 50 1 2 3 8 3 20 2 45 11 011 0 3 20 1 2 12 50 3 20 3 8Sam... 阅读全文
posted @ 2014-03-12 23:19 贾树丙 阅读(344) 评论(0) 推荐(0) 编辑
摘要: Divide and Count题目大意:给定箱子的数量和每个箱子的容量,在每个箱子里都装满对应容量的宝石,每颗宝石都是独一无二的,求一共有多少种放置方式。但是如果两个箱子的容量相同,则认为是 同一种箱子Sample input:23 331 2 3Sample output:1060分析:这是练习赛的时候处在HUST上的题目,当时感觉代码完全对了,却坑了半天,看了题解才发现,是最后除以相同的箱子的时候,是除以它的数量的阶乘,本来是这么想的,却先把它们给乘起来了,样例只是碰巧对而已。也用不到64位整数。代码如下: 1 #include 2 # include 3 # include 4 u.. 阅读全文
posted @ 2014-03-12 23:09 贾树丙 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 效果图如下: 阅读全文
posted @ 2014-02-18 05:57 贾树丙 阅读(816) 评论(0) 推荐(0) 编辑
摘要: 效果图如下: 阅读全文
posted @ 2014-02-18 05:55 贾树丙 阅读(1141) 评论(0) 推荐(0) 编辑
摘要: 效果图如下: 阅读全文
posted @ 2014-02-18 05:53 贾树丙 阅读(628) 评论(0) 推荐(0) 编辑
摘要: 编写一个程序,打印输出下列5×5螺旋方阵: 12345 161718196 152425207 142322218 131211109 1 public class Main 2 { 3 public static void main(String args[]) 4 { 5 int map[][] = new int[5][5]; 6 for(int i=0;i4 || tb>4 || ta<0 || tb<0)18 {19 c = (c+1)%4;20 ... 阅读全文
posted @ 2014-01-02 10:51 贾树丙 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 程序功能:创建一个带有文本区及“对话框”按钮的父窗口,单击“对话框”按钮可打开一个自定义对话框,从中可以定义行和列的数值,关闭对话框其设置的设置会显示在父窗口的文本区中。产生界面如下图所示: 1 import javax.swing.*; 2 3 import java.awt.*; 4 import java.awt.event.*; 5 6 7 public class LX9_20 extends JFrame implements ActionListener 8 { 9 int row =10,col =40;10 JPanel p1 = new JPanel(... 阅读全文
posted @ 2013-12-31 13:10 贾树丙 阅读(481) 评论(0) 推荐(1) 编辑
摘要: 程序功能:在窗口中添加菜单栏,在菜单栏添加菜单项,并添加下拉菜单和2级菜单,通过选择菜单项可以执行不同操作,生成如下图所示窗口。 1 import java.awt.*; 2 import java.awt.event.*; 3 import javax.swing.*; 4 5 class MyWin2 extends JFrame 6 { 7 JMenuItem item1=new JMenuItem("复制"); 8 JMenuItem item2=new JMenuItem("剪切"); 9 JMenuItem item3=new JMenuIt 阅读全文
posted @ 2013-12-31 13:08 贾树丙 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 编写程序:在窗口中添加组件,产生如下图形化界面:当用户输入用户名和电话后,点击显示按钮后,按下图格式显示。 1 import java.awt.*; 2 import java.awt.event.*; 3 import javax.swing.*; 4 5 class MyWind extends JFrame implements ActionListener 6 { 7 TextField text1,text2,text3; 8 JButton btn1,btn2; 9 JTextArea ta1;10 JPanel pnl;11 JLabel... 阅读全文
posted @ 2013-12-31 13:05 贾树丙 阅读(314) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 39 下一页