码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
C++学习笔记——01
最近准备跳槽的事情,于是把C++翻出来看,顺便做了一些练习,主要是数据结构方面的,就贴在这里做个系列,权当督促自己了。第一天,写了一个栈,调试了下没什么问题,内存泄露的问题也解决了。 1 #ifndef STACK_H 2 #define STACK_H 3 4 #include "std...
分类:编程语言   时间:2014-07-02 20:35:37    阅读次数:216
顺序查找,折半查找,二叉排序树的建立,哈希表的建立
以下四个验证性实验都做。(1)顺序查找验证(2)折半查找验证(3)二叉排序树的建立(4)哈希表的建立#include#include#include#include#include#includeusing namespace std;class dijiuzhang{public: int ...
分类:其他好文   时间:2014-07-02 20:24:09    阅读次数:374
std::vector<std::vector<> >
上次看到这个有点晕了,其实这个vector保存的是std::vector#include #include using namespace std;int main(){ std::vector > num; std::vector a(10, 5); num.push_back(...
分类:其他好文   时间:2014-07-02 20:14:53    阅读次数:182
分支-05. 用天平找小球(10)
#includeusing namespace std;int main(){ int a,b,c; cin>>a>>b>>c; if(a==b) cout<<"C"<<endl; else if(b==c) cout<<"A"<<endl; else cout<<"B"<<endl; ret...
分类:其他好文   时间:2014-07-02 19:25:08    阅读次数:200
分支-02. 三角形判断(15)
#include#include#includeusing namespace std;int main(){ double a[2],b[2],c[2]; double l,m,n,p,s; cin>>a[0]>>a[1]>>b[0]>>b[1]>>c[0]>>c[1]; l=sqrt(pow(a...
分类:其他好文   时间:2014-07-02 19:15:50    阅读次数:181
分支-04. 出租车计价(15)
#includeusing namespace std;int main(){ double miles; int time,fee; while(cin>>miles>>time){ if(miles<=3) fee=10+(time/5)*2; else if(miles<=10) ...
分类:其他好文   时间:2014-07-02 19:13:40    阅读次数:241
分支-06. 成绩转换(15)
#includeusing namespace std;int main(){ int p; while(cin>>p) if(p>=90) cout=80) cout=70) cout=60) cout<<"D"<<endl; else cout<<"E"<<endl; r...
分类:其他好文   时间:2014-07-02 18:57:53    阅读次数:152
分支-03. 三天打鱼两天晒网(15)
#includeusing namespace std;int main(){ int days; while(cin>>days){ if(days%5=1) cout<<"Fishing in day "<<days<<endl; else cout<<"Drying in day ...
分类:其他好文   时间:2014-07-02 14:50:19    阅读次数:198
001~003
ProjectEuler// 001 1 #include 2 3 using namespace std; 4 5 int main() 6 { 7 int sum = 0; 8 for (int i = 3; i 2 3 using namespace std; 4 ...
分类:其他好文   时间:2014-07-02 14:40:32    阅读次数:232
POJ 1135 Domino Effect
最短路问题,我用的SPFA。 求出各个点的最短时间。 然后每条边的为 (d[u]+d[v]+len)/2   len 为此边长度。 然后找时间最长的。 #include #include #include #include #include using namespace std; int n,m; struct lx { int v; double t; }; v...
分类:其他好文   时间:2014-07-02 11:34:13    阅读次数:136
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!