摘要: 问题:STL学得真不过关啊 ,用到时就像不起来,while(cin.get(c))在结束时,先换行,即按下回车键,在按ctl+z键,代码是看了别人之后,自己重写的。STL还是要好好学,真的很有用,可以吧复杂的问题变得简单。代码:#include <iostream>#include <vector>using namespace std;int main(){ vector<char> s; char c; int beg,len; while(cin.get(c)) s.push_back(c); cout<<"please inpu 阅读全文
posted @ 2013-04-26 10:53 xshang 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 第十九篇星光 接连三天的英语论文翻译,让我倦了,累了,于是为了放松,有接近疯狂的玩斗地主,整个神经接近崩溃的边缘。 从今天开始还是静心看我的代码吧,知道自己英语菜的不行。 这一个星期,生物钟乱了,听着那些无病呻吟的声音,想不明白,整出来,真没意义,生命因此而贬值。 今天还算比较正常的一天吧,崭新,就像星光。 还是作息规律些吧,努力前行! 找到属于自己的那颗星和光。 好好学吧,C++和PHP,加油,实际很简单! 阅读全文
posted @ 2013-04-26 10:10 xshang 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 问题: 跟之前想的不一样,以为就是个链表,结果实现时就出问题了。 lqueue->rear要不断的后移***因此,每次入队的时候要找到lqueue->rear,因此每次入队是要后移lqueue->rear。^^代码:#include <iostream>#include <cstdlib>using namespace std;typedef struct LinkQueue{ int data; struct LinkQueue *front; struct LinkQueue *rear;}*LQueue;void initLQueue(LQueu 阅读全文
posted @ 2013-04-22 15:22 xshang 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 问题:主要是队列为空和满的条件. 为空:cqueue->front==cqueue->rear 为满(cqueue->rear+1)==cqueue->front代码:#include <iostream>#include <cstdlib>using namespace std;#define MAXSIZE 20typedef struct CQueue{ int front; int rear; int data[MAXSIZE];}*CirQueue;void initCQueue(CirQueue &cqueue){ cqueu 阅读全文
posted @ 2013-04-21 15:38 xshang 阅读(224) 评论(0) 推荐(0) 编辑
摘要: It is the first to go out with my classments. we get on the bus,and after half an hour,we reach the destination.I feel excited.The building is so beautiful.and xiaoZhe say it is just city.We laugh.Lives are full of fun.We need to feel the air and into the feeling. urban or village,is the key?we sho. 阅读全文
posted @ 2013-04-20 21:01 xshang 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 问题:今天累了,没心情写,但我知道路漫漫,还是要坚持,要进步。顺序队列比较简单,明白原理就行。注:判断队列为空的条件:squeue->front==squeue->rear;代码:#include <iostream>#include <cstdlib>using namespace std;#define MAXSIZE 20typedef struct SQueue{ int data[MAXSIZE]; int front; int rear;}*SeqQueue;void initSeqQueue(SeqQueue &squeue) //初始 阅读全文
posted @ 2013-04-20 20:30 xshang 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 问题:建立顺序栈还是比较简单的。主要是一开始在入栈操作中每次调用初始化栈函数,结构出错。代码:#include <iostream>#include <cstdlib>using namespace std;#define MAXSIZE 20typedef struct SeqStack{ int stack [MAXSIZE]; int top;}*stackNode;void initStack(stackNode &stack){ stack=(stackNode)malloc(sizeof(struct SeqStack)); if(!stack) { 阅读全文
posted @ 2013-04-19 15:36 xshang 阅读(759) 评论(0) 推荐(0) 编辑
摘要: 问题:我用的是尾插入法,主要是在输出的时候循环条件不要用错了^^,昨天查资料时遇见了一批“外星人”,今天看循环链表时又遇见“外星人”了**!贴代码:#include <iostream>#include <cstdlib>using namespace std;typedef struct CircleList{ int data; struct CircleList *next;}*CList;void createCList(CList &clist){ CList head,node; int c; clist=(CList)malloc(sizeof(s 阅读全文
posted @ 2013-04-18 16:40 xshang 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 问题:在分配空间时,遇到问题定义一个结构体:typedef struct dLinkListNode{int data;struct dLinkListNode *prior;struct dLinkListNode *next;}*dLinkList,dListNode;dList=(dLinkList)malloc(sizeof(dListNode));与dList=(dLinkList)malloc(sizeof(dLinkList));是不一样的,即指针和结构体的大小不一样,不要想当然。指针的问题真的小心,一不小心就出错。代码:#include <iostream>#inc 阅读全文
posted @ 2013-04-17 16:10 xshang 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 第十八篇不放弃的担当在社会的一次又一次的变革中,我还是我。遥远的距离,不是你我的障碍,我依然可以看到你。 枫叶纷纷落,为红尘,我只亦凡人。逃脱不了你的美丽。在眷恋你的一回眸,千年的感动,或许因为你的存在。我的感情很冷,却曾被你燃起的火热。 天外天的世界,可我只能看到你。 坚持的力量,不放弃的担当,源为你。我的透过眼里的深情折射,等待你的回应。在林夕的安然里,你我心有灵犀。枫叶飞飞舞,为留恋,你款款的身姿,共舞。尘光交错中,看到你的美。 愿为了你的感动,不在楼台亭宇,不需要,不在小桥流水,细腻不是因为环境的左右。坚持的力量,永不放弃的担当,为了你的心有灵犀,我刚毅。 阅读全文
posted @ 2013-04-17 12:36 xshang 阅读(97) 评论(0) 推荐(0) 编辑