• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            glxhyt

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              15 隨筆 :: 0 文章 :: 4 評論 :: 0 Trackbacks

            #

                 摘要:                                 結果:  &...  閱讀全文
            posted @ 2010-09-26 21:11 郭龍 閱讀(1541) | 評論 (0)編輯 收藏

                 摘要:             日記 2010-4-5 關于MFC中的文本的編程: 簡單是: 1,在CTestView中定義兩個變量一個為CPoint的m_ptOrigin并設置為0;和 CString 的m_strLine的并設置為“”,在CTextView中。Cpp設置...  閱讀全文
            posted @ 2010-08-21 17:27 郭龍 閱讀(1125) | 評論 (0)編輯 收藏

              1//#include "stack.h"
              2
              3#pragma once
              4#include <iostream>
              5
              6using namespace std;
              7class Stack
              8{
              9public:
             10    Stack(void);
             11    virtual ~Stack(void);
             12public:
             13    virtual void push (char c) = 0;
             14    virtual char pop () = 0;
             15}
            ;
             16
             17
             18//#include "ListStack.h"
             19
             20#pragma once
             21#include "stack.h"
             22#include <list>
             23
             24class ListStack :
             25    public Stack
             26{
             27    friend ostream& operator <<(ostream& out, ListStack &rht);
             28public:
             29    ListStack(void);
             30    ~ListStack(void);
             31
             32public:
             33    virtual void push (char c);
             34    virtual char pop();
             35
             36public:
             37
             38    list<char> m_ls;
             39    
             40}
            ;
             41
             42
             43//#include "stack.cpp"
             44
             45#include "StdAfx.h"
             46#include "Stack.h"
             47
             48Stack::Stack(void)
             49{
             50}

             51
             52Stack::~Stack(void)
             53{
             54}

             55
             56
             57// #include "ListStack.h"
             58
             59
             60#include "StdAfx.h"
             61#include "ListStack.h"
             62#include <iterator>
             63#include <list>
             64ListStack::ListStack(void)
             65{
             66}

             67
             68ListStack::~ListStack(void)
             69{
             70}

             71
             72void ListStack::push(char c)
             73{
             74
             75    m_ls.push_front(c);
             76}

             77
             78char ListStack::pop()
             79{
             80    char c =  m_ls.front();
             81        m_ls.pop_front();
             82    return c;
             83
             84}

             85ostream& operator <<(ostream &out, ListStack &rht)
             86{
             87    cout<<"stack element";
             88    list<char>::iterator beg = rht.m_ls.begin();
             89    list<char>::iterator end = rht.m_ls.end();
             90    for(; beg != end; beg -- )
             91
             92      out<<rht.pop();
             93
             94
             95    return out;
             96}

             97
             98
             99 
            100
            101//main.cpp
            102
            103// c++stack.cpp : 定義控制臺應用程序的入口點。
            104//
            105
            106#include "stdafx.h"
            107#include "ListStack.h"
            108#include <iterator>
            109
            110int _tmain(int argc, _TCHAR* argv[])
            111{
            112
            113    ListStack liststack;
            114    int num = 5;
            115    while( num --)
            116    {
            117        char  temp;
            118        cout<<"input alphat"<<endl;
            119        cin>>temp;
            120        liststack.push( temp );
            121    }

            122    
            123      //num =5;
            124     //cout<<liststack<<endl;
            125    //while(num --)
            126    //{
            127
            128    //   cout<<liststack.pop();
            129
            130    //}
            131    list<char>::iterator beg = liststack.m_ls.begin();
            132    list<char>::iterator end = liststack.m_ls.end();
            133    for(; beg != end; ++ beg )
            134        //cout<<liststack.pop()<<" ";
            135        cout<<*beg <<endl;
            136    
            137    cout<<endl;
            138    return 0;
            139}

            140
            141
            142
            143
            posted @ 2010-08-19 19:21 郭龍 閱讀(251) | 評論 (0)編輯 收藏

                 摘要:   1#ifndef _LOGING_  2#define _LOGING_  3#include <iostream>  4#include <string>  5#include <fstream> ...  閱讀全文
            posted @ 2010-08-19 19:18 郭龍 閱讀(1670) | 評論 (0)編輯 收藏

                 摘要:   著名的Josephus問題   據說著名猶太歷史學家 Josephus有過以下的故事:在羅馬人占領喬塔帕特後,39 個猶太人與Josephus及他的朋友躲到一個洞中,39個猶太人決定寧愿死也不要被人抓到,于是決定了一個自殺方式,41個人排成一個圓圈,由第1個人開始報數,每報數到第3人該人就必須自殺,然后再由下一個重新報數,直到所有人都自殺身亡為止。   然而Josephus ...  閱讀全文
            posted @ 2010-08-11 19:39 郭龍 閱讀(379) | 評論 (0)編輯 收藏

            僅列出標題
            共2頁: 1 2 
            久久人妻少妇嫩草AV蜜桃| 热久久国产欧美一区二区精品| 久久人人爽人人爽人人爽| 亚洲香蕉网久久综合影视| 久久99国产综合精品| 久久91精品综合国产首页| 99久久99久久精品国产片果冻 | 天天综合久久久网| 人妻精品久久久久中文字幕| 久久综合久久自在自线精品自| 国产精品gz久久久| 99久久久国产精品免费无卡顿| 久久亚洲中文字幕精品一区| 国产亚洲美女精品久久久久狼| 亚洲性久久久影院| 国产亚洲美女精品久久久| 狠狠色丁香久久婷婷综合五月| 久久婷婷色香五月综合激情| 99久久精品免费国产大片| 久久久久久久亚洲Av无码| 久久人妻AV中文字幕| 久久免费视频一区| 久久久久国产一区二区三区| 国产美女久久久| 99精品久久精品| 久久国产精品一国产精品金尊| 国产成人精品综合久久久| 日日狠狠久久偷偷色综合96蜜桃 | 狠狠色婷婷久久综合频道日韩 | 久久精品国产久精国产一老狼| 久久人妻少妇嫩草AV无码蜜桃 | 精品久久久久久亚洲精品 | 欧美亚洲另类久久综合婷婷| 亚洲国产二区三区久久| 久久这里只有精品久久| 88久久精品无码一区二区毛片 | 亚洲а∨天堂久久精品9966| 久久精品国产99久久丝袜| 国产成人精品久久亚洲| 久久久久国产精品麻豆AR影院| 久久国产乱子伦精品免费午夜|