码迷,mamicode.com
首页 >  
搜索关键字:operator-    ( 3564个结果
复数四则及比较运算
#include #include class complex{public: friend istream & operator >> (istream & ,complex &); //提取运算符重载友元函数声明。 friend ostream & operator d2) cout|z2|">...
分类:其他好文   时间:2015-06-10 21:01:44    阅读次数:135
Excel 数据验证宏
Sub 宏1()'' 宏1 宏'' With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, For...
分类:其他好文   时间:2015-06-10 10:14:14    阅读次数:127
HDU ACM 1392 Surround the Trees->凸包
分析:直接求出凸包,再算边长即可。另外只有一个点时为0.00单独处理,两个点直接为距离也单独处理。 #include #include #include using namespace std; struct Point { Point(){} Point(double _x,double _y):x(_x),y(_y){} Point operator-(const Point& a)...
分类:其他好文   时间:2015-06-09 17:12:49    阅读次数:114
【Divided Two】cpp
题目:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.代码:class Solution {public: int div...
分类:其他好文   时间:2015-06-09 16:31:20    阅读次数:97
Python批量删除指定文件夹下的指定类型的文件
Python作为一种脚本语言,其非常适合文件级的各种操作。下面的代码可以批量删除指定文件夹下的全部特定类型(CSV类型)的文件。 import sys, csv , operator import os import glob for i in range(0, 20): path = "C:\\Python34\\Folder_" + str(i) for infile in glo...
分类:编程语言   时间:2015-06-09 13:52:29    阅读次数:123
为包含指针的关联容器指定比较类型
一、等价与相等的简述 在容器中,等价并不是相等。为什么要提等价与相等呢?因为泛型算法中的find等用于比较的是相等,即以operator==为基础,而容器成员函数的比较是以operator 2 3 struct CIStringCompare{ 4 bool operator()(con...
分类:其他好文   时间:2015-06-09 00:41:29    阅读次数:134
用C++编写Int函数
用C++编写Int函数来实现基本运算如下: #include using namespace std; class Int { public: Int(int i=0):m_i(i) {} ~Int() {} Int& operator++() //前置++ { m_i++; return *this; } In...
分类:编程语言   时间:2015-06-08 10:01:38    阅读次数:136
类string的构造函数、拷贝构造函数和析构函数
String 类的原型如下class String{ public: String(const char *str=NULL);//构造函数 String(const String &other); //拷贝构造函数 ~String(void); //析构函数 String& operator=(c...
分类:其他好文   时间:2015-06-08 00:55:26    阅读次数:199
【C++】String类中的运算符重载
模块化设计: 头文件: #ifndef operator_operator_h #define operator_operator_h #include #include using namespace std; class MyString { public: //三个重载的构造函数 MyString(); MyString(const c...
分类:编程语言   时间:2015-06-07 14:35:41    阅读次数:304
c++ 复制控制 之赋值操作符
重载操作符      重载操作符是一些函数, 其名字为operator后跟着其所定义的操作符符号.  如operator =, operator +, operator * 等等.      操作符函数和普通函数一样, 也是 返回值 + 函数名 + (形参表) , 形参表必须具有与该操作符操作数数目相同的形参(如果操作符是一个成员, 则包括隐式this形参). 赋值操作符     ...
分类:编程语言   时间:2015-06-07 09:48:44    阅读次数:210
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!