#include
using namespace std;
class Date; //对Date类的提前引用声明
class Time
{
public:
Time(int,int,int);
void add_a_second(Date &); //增加1秒,1秒后可能会到了下一天,乃到下一月、下一年
void display(Date &); //显示时间,...
分类:
其他好文 时间:
2014-06-08 18:17:22
阅读次数:
216
#include
#include
#include
using std::cout;
using std::endl;
int main(void){
//使用默认种子值产生随机数,每次产生的都一样
cout << rand() << " " << rand() << " " << rand() << endl;
//使用新种子产生随机数,每次都不一样
...
分类:
编程语言 时间:
2014-06-08 17:26:30
阅读次数:
215
#include
#include
using namespace std;
class CPoint//点类
{
private:
double x;//横坐标
double y;//纵坐标
public:
//使用初始化表初始化数据成员
CPoint(double xx=0,double yy=0):x(xx),y(yy){}
...
分类:
其他好文 时间:
2014-06-08 15:38:11
阅读次数:
299
本文翻译了这篇文章:Using the Android action bar (ActionBar) - Tutorial
1、ActionBar的简介
ActionBar位于Activity的顶部,可用来显示activity的标题、Icon、Actions和一些用于交互的View。它也可被用于应用的导航。
ActionBar 是在Android 3.0(API 11)中加入到SK中的,...
分类:
移动开发 时间:
2014-06-08 15:27:58
阅读次数:
349
day01笔记
using namespace cocos2d; == USING_NS_CC; 一般用后面的
#ifndef __MYLAYER_H__
#define __MYLAYER_H__
---------------一般添加头文件添加宏
: public CCLayer 一般添加一个类继承CCLayer
CCLayer::init();
CCLab...
分类:
其他好文 时间:
2014-06-08 15:23:33
阅读次数:
191
模式定义:
单例模式确保一个类只有一个实例,并提供一个全局访问点。
模式结构:
单例模式编程实现及执行结果:
#include
using namespace std;
单例类
class Sigleton
{
public:
static Sigleton* getInstance();
private:
Sigleton(){}
stat...
分类:
编程语言 时间:
2014-06-08 15:08:54
阅读次数:
242
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace mapReduce
{
public static class helper
{
public static Dictionary MapReduce(
...
分类:
其他好文 时间:
2014-06-08 10:39:41
阅读次数:
227
根据下面关系式,求圆周率的值,直到最后一项的值小于给定阈值。
输入格式:
输入在一行中给出小于1的阈值。
输出格式:
在一行中输出满足阈值条件的近似圆周率,输出到小数点后6位。
输入样例:
0.01
输出样例:
3.132157
#include
#include
using namespace std;
int main() {
...
分类:
其他好文 时间:
2014-06-08 10:39:26
阅读次数:
250
先在这里记录一下代码!原理将来再补吧!
这个算法算是有一个致命的弱点吧!那就是如果元素的个数达不到2^n个的话,要填充!#include
using namespace std;
void SortDown(int , int);
void MergeUp(int, int);
void MergeDown(int, int);
void Exchange(int , int);
vo...
分类:
其他好文 时间:
2014-06-08 09:15:43
阅读次数:
225
//读取报告数据
string data=null;
using (System.IO.StreamReader sr = new System.IO.StreamReader(filePath, System.Text.Encoding.Default))
{
...
分类:
其他好文 时间:
2014-06-08 08:27:59
阅读次数:
236