码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
HDOJ 1196 Lowest Bit
题目大意是给一个1-100的整数,要求首先转化成2进制,然后从最低位开始数起到不是0的位停止,输出这些位代表队额10进制数 1 #include 2 3 using namespace std; 4 5 int bits[7]={1,2,4,8,16,32,64}; 6 int judge(i...
分类:其他好文   时间:2014-06-16 08:10:21    阅读次数:226
重载 模板 inline
重载:函数名相同,参数类型和个数不同模板:函数名相同,个数相同,参数类型不同#include using namespace std;template T Max(T a, T b){ if(a > b) return a; else return b;}void main(){ int a = 1...
分类:其他好文   时间:2014-06-16 08:05:04    阅读次数:231
C++默认参数
c++支持默认参数,但是默认参数应该放在参数的最右端。如float area(float r=6.5);area()即可调用,或者area(7.5)覆盖默认参数一个函数不能既作为重载函数,又作为有默认参数的函数。#include using namespace std;int main( ){ .....
分类:编程语言   时间:2014-06-16 07:43:44    阅读次数:255
SRM 587 DIV1
550结论:同一层的交点共线。很容易猜到,也可以跑几组数据验证。利用结论就可以按层算,再利用对称性简化计算。 1 using namespace std; 2 #define maxn 70100 3 class TriangleXor { 4 public: 5 int theArea(i...
分类:其他好文   时间:2014-06-16 07:18:41    阅读次数:184
deque
#include #include using namespace std;int main(int argc, char *argv[]){ deque A, B; deque ::iterator it; A.push_front(1); B.push_back(1); ...
分类:其他好文   时间:2014-06-16 07:17:15    阅读次数:199
windows系统调用 调度优先级
1 #include "iostream" 2 #include "windows.h" 3 using namespace std; 4 5 class CWorkerThread{ 6 public: 7 CWorkerThread(LPCTSTR m_szName):m_szNam...
分类:Windows程序   时间:2014-06-13 18:30:42    阅读次数:325
计算几何基本函数
#include #include #include #include #include using namespace std ;const double eps = 1e-8;const double PI = acos(-1.0);int sgn(double x){ if(fabs(x...
分类:其他好文   时间:2014-06-13 18:08:05    阅读次数:307
LeetCode OJ--Permutations II
给的一个数列中,可能存在重复的数,比如 1 1 2 ,求其全排列。记录上一个得出来的排列,看这个排列和上一个是否相同。#include #include #include using namespace std; class Solution{public: vector > permuteU...
分类:其他好文   时间:2014-06-13 17:53:39    阅读次数:280
LeetCode OJ--Next Permutation *
求一个排列的下一个排列。1,2,3→1,3,23,2,1→1,2,31,1,5→1,5,1#include #include #include using namespace std; class Solution{public: void nextPermutation(vector &nu...
分类:其他好文   时间:2014-06-13 16:41:56    阅读次数:173
Boost之智能指针的类别比较
Boost智能指针——scoped_ptrboost::scoped_ptr和std::auto_ptr非常类似,是一个简单的智能指针,它能够保证在离开作用域后对象被自动释放。下列代码演示了该指针的基本应用:#include #include #include class imple...
分类:其他好文   时间:2014-06-13 14:42:54    阅读次数:299
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!