上一页 1 ··· 7 8 9 10 11 12 下一页
摘要: #include<iostream>//#include<list.h>#include<iterator>#include<vector>#include<string>using namespace std;void main(){ string s1[4]={"fine","fish","fashion","fate"}; string s2[2]={"busy","bate"}; string s3[3]={ 阅读全文
posted @ 2013-02-23 15:01 叶城宇 阅读(99) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<algorithm>#include<deque>#include<string>//#include <vector>#include <map>//#include <set>using namespace std;void main(){ deque<char>a; for(int i=0;i<5;a.push_back('5'-i++)); cout<<"size::"<< 阅读全文
posted @ 2013-02-23 15:00 叶城宇 阅读(132) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<iterator>#include<vector>using namespace std;void main(){ int a[10]={6,7,2,9,4,11,8,7,10,5}; vector<int>b(10); copy(a,a+10,b.begin()); cout<<"let the b be a!\n"; ostream_iterator<int,char>out(cout," "); copy(b.begin() 阅读全文
posted @ 2013-02-23 14:59 叶城宇 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>using namespace std;void main(){ string s1,s2="6";int s3;cin>>s1;cout<<"s1::"<<s1<<endl;getline(cin,s2,'x');cout<<"s2::"<<s2<<"%%%"<<endl;//getline(cin,s3);} 阅读全文
posted @ 2013-02-23 14:58 叶城宇 阅读(157) 评论(0) 推荐(0) 编辑
摘要: //队列的链式存储结构(还没写遍历)==============#include<iostream>using namespace std;typedef struct qnode{ int data; struct qnode *next ;}qnode,*queueptr;typedef struct{ queueptr front; queueptr rear;}linkqueue;///////////////////int initqueue(linkqueue &q){ q.front=q.rear=(queueptr)malloc (sizeof(qnode) 阅读全文
posted @ 2013-02-23 14:55 叶城宇 阅读(194) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;void main(){ int a=5,b=6;int i,j;int **c = new int*[b]; for( i=0;i<b;i++) c[i] = new int[a]; //使用时用 arData[i][j]格式 0 <=i <nHeight, 0 <=j <nWidth //结束时清除 cout<<c<<endl;for(i=0;i<b;i++) for(j=0;j<a;j++) c[i][j]=i+j;for(i=0;i& 阅读全文
posted @ 2013-02-23 14:54 叶城宇 阅读(124) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;typedef struct qnode{ int data; struct qnode *next ;}qnode,*queueptr;typedef struct{ queueptr front; queueptr rear;}linkqueue;///////////////////int initqueue(linkqueue &q){ q.front=q.rear=(queueptr)malloc (sizeof(qnode)); if(!q.front) return 0; q.fron 阅读全文
posted @ 2013-02-23 14:52 叶城宇 阅读(169) 评论(0) 推荐(0) 编辑
摘要: // 磁盘调度算法.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include<iostream>using namespace std;#include<cmath>const int MaxNumber=100; int TrackOrder[MaxNumber];//磁道访问序列 int MoveDistance[MaxNumber];//移动的磁道数 double AverageDistance;//平均寻道长度 bool direction;//移动方向;若为1时是想磁道号增加的方向访问,否者,反方向 阅读全文
posted @ 2012-12-01 14:46 叶城宇 阅读(283) 评论(0) 推荐(0) 编辑
摘要: // VC08---虚拟内存页面置换算法.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include<iostream>using namespace std;const int MaxNumber=100; int PageOrder[MaxNumber];//页面访问序列 int Simulate[MaxNumber][MaxNumber];//访问各个时刻物理块的记录 int PageCount[MaxNumber];//物理块 int PageNum,LackNum,blockNum;//PageNum页面个数,L 阅读全文
posted @ 2012-11-29 17:50 叶城宇 阅读(943) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;const int MaxNumber=100;struct Node{char elem;//空闲空间名称(大写字母)int FreePartition;//空闲空间还剩余的大小char Par_set[MaxNumber];//分配给的进程名称(小写字母)};Node FreePartition[MaxNumber];Node FirstPartition[MaxNumber];Node CycleFirstPartition[MaxNumber];Node BestPartition[MaxNumbe 阅读全文
posted @ 2012-11-16 16:40 叶城宇 阅读(3358) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 下一页