
C/C++
文章平均质量分 53
jakqigle
好好学习,天天向上
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
最大间隙问题
#include #include using namespace std;int getMaxpos(vectordouble> nums,int n){ int maxPos = 0; double tmp = nums.at(maxPos); for(int i = 1; i { if( nu原创 2008-09-20 00:02:00 · 820 阅读 · 0 评论 -
抽象工厂模式学习代码
#include using namespace std;class PC_Game{public: virtual void play(){ cout<<"0/n";}};class PC_SanGuo :public PC_Game{public: void play(){ cout<<"单机版三国游戏/n";}};class PC_CS原创 2009-07-02 23:19:00 · 633 阅读 · 0 评论 -
qsort的用法解析(转)
关于qsort的使用:qsort对于排序有更好的兼容性,可以对任何数据类型,采取个人需要的排序关键字和排序方法进行升序排序,在stdlib.h中,它的函数原型是void qsort(void *base, //所要排序的数组第一个元素的地址 size_t nelem, //要排序的元素的个数 size_t width, //要排序的元素的宽度转载 2008-09-20 17:50:00 · 851 阅读 · 0 评论 -
关于语言的选择-选易用的
首先, 这篇文章不是对@左耳朵耗子的C++的坑真的多吗?一文的反驳, 我只是在我的理解角度说一下我对语言选择的一些感悟.关于C和C++的争论, 由来已久, 从当年Linus攻击C++是恐怖的语言的时候, 就一直没有停歇, 而就我自己来说, 我对C++的掌握还远远不够, 所以没有能力来从语言设计角度来对比(我在最初, 也尝试学过C++, 用过C++, 但后来发现, 我学不好, 用不好,转载 2012-08-07 22:27:01 · 728 阅读 · 0 评论 -
Merry Christmas
/* **** input:The input consists of multiple test cases. Each test case consists of two positive interge原创 2008-09-20 00:18:00 · 607 阅读 · 0 评论 -
u Calculate e
#include #include #include using namespace std;double fun(int n){ double back = 1.0; for(int i = 1;i back = back * double(i); return back;}int main()原创 2008-09-20 00:24:00 · 667 阅读 · 0 评论 -
半数集问题
#include using namespace std;long long mm[1000000];long long ff(int num){ long long pc = 1; if( mm[num] > 0 ) return mm[num]; else{ for(int i = 1; i原创 2008-09-20 00:14:00 · 636 阅读 · 0 评论 -
最多约数问题
#include using namespace std;int getDiv(int iNum) { int i = 1; int sum = 0; if ( iNum return 0; while (i { if (iNum % i == 0) s原创 2008-09-20 00:09:00 · 1086 阅读 · 0 评论 -
字典序问题
#include #include using namespace std;int ff(int ii,int k){ int sum = 0; if( k return 1; else{ for(int m = ii+1; m { sum原创 2008-09-20 00:07:00 · 901 阅读 · 0 评论 -
数字统计问题
#include #include #include #include #include using namespace std;double string_to_num(string str){ double back; istringstream instr(str); instr>>back; re原创 2008-09-20 00:05:00 · 716 阅读 · 0 评论 -
Quicksum
#include #include using namespace std;int main(){ const char* pch; int i = 0; while(1) { int sum = 0; string str; getline(cin,str);原创 2008-09-20 00:15:00 · 625 阅读 · 0 评论 -
近似平方根
//用迭代法求近似平方根 #include #include using namespace std;int main(){ int flag = 0; cout"please enter a number:"; double a = 0.0; cin>>a; const double EPSTLON =原创 2008-09-20 00:26:00 · 651 阅读 · 0 评论