上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 29 下一页
摘要: /*public static void main(String [] args)* 主函数:是一个特殊的函数,作为程序的入口,可以被jvm调用* 主函数的定义:* public:代表该函数访问权限是最大的* static: 代表主函数随着类的加载已经存在,* void:主函数没有具体的返回值* main:不是关键字,但是一个特殊的单词,可以被jvm调用* (String [] args) :函数类型是一个类型,该数组中的元素是字符串,字符串类型的数组* 主函数是固定格式的jvm识别*/public class MainDemo {/** 引用数据类型,一个值或null*/ public st 阅读全文
posted @ 2013-12-14 16:04 天天AC 阅读(315) 评论(0) 推荐(0)
摘要: More is betterTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 11102Accepted Submission(s): 4133Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be 阅读全文
posted @ 2013-12-14 15:28 天天AC 阅读(337) 评论(0) 推荐(0)
摘要: 小希的迷宫Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21663Accepted Submission(s): 6620Problem Desc... 阅读全文
posted @ 2013-12-13 21:46 天天AC 阅读(269) 评论(0) 推荐(0)
摘要: 1 =============================以下是最小生成树+并查集====================================== 2 【HDU】 3 1213 How Many Tables 基础并查集★ 4 1272 小希的迷宫 基础并查集★ 5 1325&&poj1308 Is It A Tree? 基础并查集★ 6 1856 More is better 基础并查集★ 7 1102 ... 阅读全文
posted @ 2013-12-13 07:33 天天AC 阅读(241) 评论(0) 推荐(0)
摘要: /*当成员被静态修饰后,就多了一个调用的方式,除了被对象调用外,还可以被类名调用,类名,静态成员static 的特点1.随着类的加载而加载,也就是随着类的消失而消失,说明她的生命周期最长,2.优先于对象存在明确一点,静态是先存在,对象是后存在。3.被所有的对象所共享,4.可以直接被类名所调用实类变量和类变量的的区别1. 存放位置类变量随着类的加载存在于方法中实类变量随着对象的建立存在于堆内存中2.生命周期类变量的生命周期最长,随着类的消失而消失实类变量随着对象的消失而消失静态的使用注意事项1.静态的方法只能访问静态的成员和成员方法非静态既可以访问静态成员又可以非静态成员2.静态方法中不可以定义 阅读全文
posted @ 2013-12-12 21:19 天天AC 阅读(235) 评论(0) 推荐(0)
摘要: 用邻接矩阵存储有向图,并输出各个定点的出入度由于没有权值,两个定点之间的权值为1,没有注意memset(e,0,sizeof(e));我考试问题就在这。。。气炸了测试样例一: 1 input: 2 7 9 3 1 2 4 2 3 5 2 5 6 2 6 7 3 5 8 4 3 9 5 210 5 411 6 712 0 013 output14 1 3 1 1 2 1 015 0 2 2 1 2 1 1View Code 测试样例二: 1 input: 2 5 5 3 1 2 4 2 3 5 3 4 6 4 5 7 5 1 8 output: 9 1 1 1 1 110 1 1 1 1 1Vi 阅读全文
posted @ 2013-12-12 17:17 天天AC 阅读(255) 评论(0) 推荐(0)
摘要: 1 import java.util.Scanner; 2 3 /** 4 * @author Administrator 递归算法折半查找 5 */ 6 public class zhebanchazhao_1 { 7 8 public static void main(String[] args) { 9 10 int[] a = new int[100];11 int x;12 Scanner cin = new Scanner(System.in);13 14 x = cin.nextInt();15 ... 阅读全文
posted @ 2013-12-10 22:42 天天AC 阅读(357) 评论(0) 推荐(0)
摘要: 1 import java.util.Scanner; 2 3 /** 4 * @author Administrator 折半查找 5 */ 6 public class zhebansousuo { 7 8 public static void main(String[] args) { 9 int[] a = new int[100];10 int x, b;11 Scanner cin = new Scanner(System.in);12 x = cin.nextInt();13 14 ... 阅读全文
posted @ 2013-12-10 22:41 天天AC 阅读(291) 评论(0) 推荐(0)
摘要: 1 # include 2 # include 3 using namespace std; 4 void visit(int e) 5 { 6 printf("%d ",e); // 以整型格式输出 7 } 8 void mid(int treenode) 9 {10 if (treenode > 5)11 return;12 visit(treenode); /*访问treenode节点*/13 mid(treenode * 2);14 mid(treenode*2 + 1);15 }16 int main()17 {18 ... 阅读全文
posted @ 2013-12-10 17:52 天天AC 阅读(188) 评论(0) 推荐(0)
摘要: 1 # include 2 # include 3 using namespace std; 4 int main() 5 { 6 int m; 7 int tree[1111]; 8 cin>>m; 9 for(int i = 0; i m)19 flag = 1;20 else21 count = count*2;22 }23 else if(flag == 1)24 {25 if(count*2... 阅读全文
posted @ 2013-12-10 17:43 天天AC 阅读(213) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 29 下一页