常见排序算法(冒泡、选择、插入、快速、归并C++实现)
#include
using namespace std;
// 冒泡排序
void bubbleSort (int data[], size_t size) {
for (size_t i = 0; i < size - 1; ++i) {
bool ordered = true;
for (size_t j = 0; j <...
分类:
编程语言 时间:
2014-09-16 22:09:41
阅读次数:
272
水题,呵呵:/*ID: qq104801LANG: C++TASK: heritage*/#include #include #include #include #include #include #include using namespace std;#define nmax 27int n,l...
分类:
其他好文 时间:
2014-09-16 22:05:21
阅读次数:
228
每个托管堆上的对象实例除了包含本身的值外,还包括:○ Type Object Ponter: 指向Type对象实例。如果是同类型的对象实例,就指向同一个Type对象实例。○ Sync Block Index:在多线程情况下用来控制同步 namespace ConsoleApplication1
{ ...
分类:
其他好文 时间:
2014-09-16 22:03:21
阅读次数:
220
#include #include #include using namespace std;int main(){ int arry[31] = {1}; int now = 1; for(int i = 1; i 0)) while(scanf("%d", &t) !=...
分类:
其他好文 时间:
2014-09-16 21:49:41
阅读次数:
263
/* 题意:Nim游戏! 思路:通过异或,判断将n个数表示成二进制的形式之后,是否对应位的数字1 的个数是偶数! */ #includeusing namespace std;int main(){ int n, x, s; while(cin>>n){ s=...
分类:
其他好文 时间:
2014-09-16 21:46:11
阅读次数:
219
原型模式主要指通过基类的指针能够动态创建出当前实际类型的实例,可以快速复制出当前的一个副本。Prototype.h内容 1 #ifndef Prototype_H_H 2 #define Prototype_H_H 3 4 #include 5 using namespace std; 6 7...
分类:
其他好文 时间:
2014-09-16 20:29:41
阅读次数:
180
记忆搜索总是一个快速的方法(这里假设测试用例中s1和s2的长度都不超过(2^16) - 1), 当然用记忆搜索的,往往就可以写成DP的形式的,不用担心大数据时栈溢出了#include #include #include #include #include using namespace std;cl...
分类:
其他好文 时间:
2014-09-16 20:23:41
阅读次数:
247
一、word这是我以前工作时写过的一个业务逻辑处理类,里面有不少文件操作的方法,这里主要关注一下C#对word的操作。里面的方法可以直接拿出来用,主要是通过word的dot模版来进行创建word、替换word等操作。namespace Excel2Word{ public class BLL ...
分类:
其他好文 时间:
2014-09-16 18:55:40
阅读次数:
218
终于搞定了单点修改线段树。。。3个月。。操蛋。。根本没有模板题。。觉得太弱了。。。艹蛋。。。必须进一步更新我的版本啊#include#include#include#includeusing namespace std;struct node{ int left,right,value;};n...
分类:
其他好文 时间:
2014-09-16 18:55:00
阅读次数:
149
1 #include 2 3 using namespace std; 4 void hello(int a ,int b=7,char* pszC="*") 5 { 6 cout<<"hello"; 7 } 8 9 int main()10 {11 // hello(5);12...
分类:
其他好文 时间:
2014-09-16 18:52:40
阅读次数:
177