#include
#include
#define CHAR_BIT 8
using namespace std;
template
class bitset
{
typedef unsigned long _Ty;
friend ostream & operator &_R)
{
for(size_t _P=_N;_P>0;)
_O<<(_R.test(--_P)?'1...
分类:
编程语言 时间:
2015-04-08 11:04:38
阅读次数:
160
题意:
给出宝藏个数,然后给出每个宝藏的位置;
如果四个宝藏构成正方形就能取走;
问最多取走几个;
#include
#include
#include
using namespace std;
const int N = 25;
int n, ans;
int cnt[105][105];
struct node {
int x;
int y;
bool operator<(no...
分类:
其他好文 时间:
2015-04-07 23:34:29
阅读次数:
384
运算符重载看起来与标准静态方法声明类似,但它们使用关键字operator和运算符本身,而不是一个方法名:public static 返回类型 operator +(类型1 变量1,类型2 变量2){ //返回类型,类型1,类型2 ,可以相同,也可以全部不同}如果使用混合类型的话,需要注意的是,不.....
#include
#include
using namespace std;
struct SchoolNo
{
int no;
friend bool operator == (const SchoolNo &school1,const SchoolNo &school2)
{
return (school1.no==school2.no);
}
friend ostrea...
分类:
编程语言 时间:
2015-04-07 15:42:48
阅读次数:
123
#include
#include
#define CHAR_BIT 8
using namespace std;
template
class bitset
{
typedef unsigned long _Ty;
friend ostream & operator &_R)
{
for(size_t _P=_N;_P>0;)
_O<<(_R.test(--_P)?'1...
分类:
编程语言 时间:
2015-04-07 15:40:31
阅读次数:
285
#include#includeusing namespace std;class sales_item{ friend istream& operator>>(istream &,sales_item&); friend ostream& operator<<(ostream&,const sal...
分类:
其他好文 时间:
2015-04-06 20:10:43
阅读次数:
135
#include#includeusing namespace std;class sales_item{ friend istream& operator>>(istream &,sales_item&); friend ostream& operator>(istream& ism,sales_...
分类:
其他好文 时间:
2015-04-06 20:06:17
阅读次数:
123
//---------------------------15/04/05----------------------------
/*
空间配置器概述:
1:new操作包含两个阶段操作
1>调用::operator new配置内存(底层使用malloc来申请内存)。
2>调用函数的构造函数,构造对象内容。
...
分类:
其他好文 时间:
2015-04-06 11:29:31
阅读次数:
151
这节课老师首先介绍了structs 和class 的区别1. Structs are value types.2. Structs can be instantiated without using a new operator.Structs can declare constructors, b...
1、顺序存储//List.h#ifndef LIST_H_#define LIST_H_#define MAXSIZE 100typedef struct _Poly{ int a; int n; bool operator == (_Poly e) { if ...
分类:
其他好文 时间:
2015-04-05 11:47:32
阅读次数:
149