在实例化类时,会自动调用构造函数构造函数可以重构当没有自定义构造函数时,系统会自动定义无参数的构造函数,但是一旦定义了一个构造函数,系统就不会自动定义无参数的构造函数#include using namespace std;class Box{public : Box(int,int,int); B...
分类:
编程语言 时间:
2014-06-19 08:35:13
阅读次数:
232
1、练习 首先编写两个数据文件A: 0,1,2 1,3,4 数据文件B: 0,5,2 1,7,8 上传到HDFS对应目录/input目录下2、运行pig ,加载A和B 加载数据A:使用指定的分隔符, grunt> a = load '/input/A' using PigStora...
分类:
其他好文 时间:
2014-06-19 00:27:03
阅读次数:
354
题目来源:HDU 2444 The Accomodation of Students
题意:n个人是否可以分成2组 每组的人不能相互认识 就是二分图判定 可以分成2组 每组选一个2个人认识可以去一个双人间 最多可以有几组
思路:二分图判定+最大匹配
#include
#include
#include
using namespace std;
const int maxn = ...
分类:
其他好文 时间:
2014-06-15 15:09:16
阅读次数:
142
File 类
File.OpenWrite 方法
StringWriter 类
File.open
//using (StreamWriter sw2 = File.CreateText(cmdFile))
using (StreamWriter sw2 = new StreamWriter(cmdFile,false, Encoding.Default)) /...
分类:
其他好文 时间:
2014-06-15 14:27:03
阅读次数:
276
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
思路:由【Leetcode】Linked
List Cycle可知,利用一快一慢...
分类:
其他好文 时间:
2014-06-15 14:23:38
阅读次数:
288
我们在C++中都用过pair.pair是一种模板类型,其中包含两个数据值,两个数据的类型可以不同.pair可以使用make_pair构造
pair p = make_pair(1, "a1");
如果传入的参数为多个,那么就需要嵌套pair,如下代码
#include
#include
using namespace std;
int main()
{
// ,注意:在嵌套模板...
分类:
编程语言 时间:
2014-06-15 13:39:48
阅读次数:
331
前段时间公司人员反应OA里的汉字拼音首字母不准他们又要用,没办法自己就从网上搜有没有好的,看了很多都是首字母拼不出来或有些字母变为另一个,但最后找了很多还是有一个好用的,暂未发现有不准的。using System;using System.Collections.Generic;using Syst...
分类:
Web程序 时间:
2014-06-15 12:58:41
阅读次数:
214
.h#include "cocos2d.h"#include "cocos-ext.h"#include "ui/CocosGUI.h"#include "cocostudio/CocoStudio.h"USING_NS_CC;USING_NS_CC_EXT;using namespace ui; ...
分类:
其他好文 时间:
2014-06-15 11:16:25
阅读次数:
276
在C++中在C++中for循环可以使用类似java的简化的for循环,可以用于遍历数组,容器,string以及由begin和end函数定义的序列(即有Iterator)
#include
#include
#include
using namespace std;
int main()
{
map ms;
ms.insert(make_pair("a", 1));
ms....
分类:
编程语言 时间:
2014-06-15 10:46:30
阅读次数:
241
UVA 294 - Divisors
题目链接
题意:求一个区间内,因子最多的数字。
思路:由于区间保证最多1W个数字,因子可以遍历区间,然后利用事先筛出的素数求出质因子,之后因子个数为所有(质因子的个数+1)的积
代码:
#include
#include
#include
using namespace std;
const int N = 35005;
in...
分类:
其他好文 时间:
2014-06-15 10:17:36
阅读次数:
158