
c++
wintersense
这个作者很懒,什么都没留下…
展开
-
map与结构体结合使用
在编写map中添加结构体的时候,转载 2014-10-26 11:11:32 · 8571 阅读 · 0 评论 -
大数运算 数组指针
#include #include #define N 20void shift(int *a,int n);void shift(int *a,int n){ int k,len,sft; len=N-1-n; sft=N-len; for(k=0;k<len;k++) *(a+k)=*(a+k+sft); for(k=len;k<N;k++) *(a+k)=0;}原创 2014-06-08 20:57:43 · 519 阅读 · 0 评论 -
大数间的运算
//任意输入两个10以内的大数据,然后进行相加计算#include #include #include #define SIZE 10main(){int a[SIZE]={0};int b[SIZE]={0};int c[SIZE+2]={0};int i;int n=SIZE;srand(time(NULL));for(i=0;i原创 2014-06-07 16:59:30 · 429 阅读 · 0 评论 -
c++ 继承示例
#include #include using namespace std;class Car{public: Car(int Weight,int Speed){ weight=Weight; speed=Speed; } void setWeight(int Weight){ weight=Weight; } void setSpeed(int Speed){原创 2014-09-22 11:17:42 · 393 阅读 · 0 评论 -
c++ 类
最近新学习类,wo原创 2014-09-23 19:29:26 · 342 阅读 · 0 评论 -
计算平面上连成线的点最大个数
Lining UpMy Tags1 (Edit) Source : ACM ICPC East Central North America 1994 Time limit : 3 sec Memory limit : 32 MSubmitted :原创 2014-10-30 09:24:33 · 483 阅读 · 0 评论 -
c++ STL 库编程 Vector
#include #include using namespace std;int main(){ vector a; vector::const_iterator i; for(int i=1;i<10;i++){ a.push_back(i); } for(i=a.begin();i!=a.end();i++){ cout<<(*i)<<endl; } system原创 2014-07-11 16:19:31 · 433 阅读 · 0 评论 -
c++ list中erase()操作
#include #include int main( ) { using namespace std; list c1; list ::iterator Iter; c1.push_back( 10 ); c1.push_back( 20 ); c1.push_back( 30 ); c1.push_back( 40 ); c1.原创 2014-09-27 09:00:40 · 2213 阅读 · 0 评论 -
C++ ofstream和ifstream详细用法
C++ ofstream和ifstream详细用法2010-07-20 00:00 中国IT实验室 佚名 关键字:C++ C语言企业软件热点文章Java调用Dll存在指针或变参的解决方法Oracle中非默认方式创建外键的使用 ofstream是从内存到硬盘,ifstream转载 2014-07-08 15:35:35 · 346 阅读 · 0 评论 -
C++ STL编程 Set
set 是容器的一种,它的特点是集合中的元素值原创 2014-07-11 17:48:59 · 463 阅读 · 0 评论 -
C++ STL编程 map
映射和多重映射用于对数据进行高效的检索。原创 2014-07-11 18:08:47 · 482 阅读 · 0 评论 -
c++ STL编程 vector中插入pair
我们知道map和multimap的作用,这两种数据类型在存储数据时,会根据pair#include#includeusing namespace std;int main(){ vector >VP; VP.push_back(make_pair(10,50)); VP.push_back(make_pair(转载 2014-07-19 15:03:39 · 1336 阅读 · 0 评论 -
C++ STL编程 Map的按Key排序和按Value排序
C++ STL中Map的按Key排序和按Value排序分类: C++拾贝2013-09-22 18:29 3890人阅读 评论(0) 收藏 举报c++编程数据结构 map是用来存放键值对的数据结构,可以很方便快速的根据key查到相应的value。假如存储学生和其成绩(假定不存在重名,当然可以对重名加以区分),我们用map来进行存储就是个不错的选择。 我们转载 2014-07-19 17:50:37 · 517 阅读 · 0 评论 -
深度搜索
NYOJ-20 吝啬的国度【深搜】分类: 搜索2011-08-08 19:47 1310人阅读 评论(1) 收藏 举报测试描述在一个吝啬的国度里有N个城市,这N个城市间只有N-1条路把这个N个城市连接起来。现在,Tom在第S号城市,他有张该国地图,他想知道如果自己要去参观第T号城市,必须经过的前一个城市是几号城市(假设你不走重复的路)。输转载 2014-10-03 08:38:08 · 444 阅读 · 0 评论