码迷,mamicode.com
首页 >  
搜索关键字:void    ( 62627个结果
数据结构--堆排序
#include #include void MaxHeapify(int a[],int length,int i); void BuildMaxHeapify(int a[],int length); void HeapSort(int a[],int length); void main(void) { int i; int a[10]={1,3,4,2,1,3,2,19,4,...
分类:其他好文   时间:2014-10-07 00:45:41    阅读次数:196
HDU 1133 Buy the Ticket 卡特兰数
设50元的人为+1 100元的人为-1 满足前任意k个人的和大于等于0 卡特兰数 C(n+m, m)-C(n+m, m+1)*n!*m! import java.math.*; import java.util.*; public class Main { /** * @param args */ public static void main(Str...
分类:其他好文   时间:2014-10-07 00:43:11    阅读次数:232
java中synchronized使用方法
synchronized的一个简单样例public class TextThread {/** * @param args */public static void main(String[] args) {// TODO 自己主动生成方法存根 TxtThread tt = new TxtThrea...
分类:编程语言   时间:2014-10-07 00:05:11    阅读次数:315
nyoj 1077 小博弈 【另类巴什博奕】
分析:分析当整除(a+b)的时候肯定是后者胜利,如果余数不等于0的时候,如果余数大于b肯定是前者胜利,否则后者胜利。 代码: import java.math.*; import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner cin = new Scanner(...
分类:其他好文   时间:2014-10-06 23:57:11    阅读次数:246
HDU 4337 King Arthur's Knights 找出一条哈密顿回路
n个点m条无向边 输出一条哈密顿回路 #include #include #include using namespace std; const int N = 155; int n, m; bool mp[N][N]; int S, T, top, Stack[N]; bool vis[N]; void _reverse(int l,int r) { while...
分类:其他好文   时间:2014-10-06 23:35:01    阅读次数:189
nyoj 322 Sort 【树状数组】
这道题其实就是考试树状数组。 代码: #include #include int c[1005]; int lowbit(int x){ return x&(-x); } int getsum(int x){ int sum = 0; while(x){ sum += c[x]; x -= lowbit(x); } return sum; } void add(int ...
分类:其他好文   时间:2014-10-06 22:17:02    阅读次数:123
C#与C++对应的类型
//c++:HANDLE(void*)----c#:System.IntPtr//c++:Byte(unsignedchar)----c#:System.Byte//c++:SHORT(short)----c#:System.Int16//c++:WORD(unsignedshort)---c#:S...
分类:编程语言   时间:2014-10-06 22:10:10    阅读次数:215
Java Reflect
1 package observer; 2 3 import java.lang.reflect.Method; 4 5 import oracle.net.aso.c; 6 7 public class Test { 8 9 public static void main(Str...
分类:编程语言   时间:2014-10-06 21:46:00    阅读次数:242
关于Java的10个谎言
下面的这些都算是比较高级的问题了,面试中一般也很少问到,因为它们可能会把面试者拒之门外。不过你可以自己找个时间来实践一下。 System.exit(0)会跳过finally块的执行 System.setSecurityManager(new SecurityManager() { @Override public void checkExit(int s...
分类:编程语言   时间:2014-10-06 21:36:00    阅读次数:225
模板系列(一)模板的模板参数
在之前,我们写过类似的stack template > class Stack { public: void push(const T &); void pop(); T top() const; bool empty() const; private: Alloc cont_; }; 那么我们使用...
分类:其他好文   时间:2014-10-06 21:18:20    阅读次数:291
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!