• <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 郭龍 閱讀(1558) | 評論 (0)編輯 收藏

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

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

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

            僅列出標題
            共2頁: 1 2 
            色天使久久综合网天天| 国内精品久久久久久99蜜桃| 久久久久亚洲AV成人网| 亚洲AV伊人久久青青草原| 久久婷婷五月综合色奶水99啪| 日韩AV无码久久一区二区| 亚洲狠狠综合久久| 99久久这里只精品国产免费| 国内精品伊人久久久久AV影院| 久久精品无码专区免费| 久久狠狠爱亚洲综合影院 | 国产精品青草久久久久婷婷| 青青草国产精品久久久久| 伊人久久久AV老熟妇色| 国产午夜福利精品久久| 久久综合给久久狠狠97色| 久久综合亚洲色HEZYO国产 | 一本一本久久a久久精品综合麻豆| 色综合久久久久久久久五月| 中文字幕无码久久久| 国产毛片久久久久久国产毛片 | 日本一区精品久久久久影院| 亚洲日韩欧美一区久久久久我| 久久99精品国产麻豆不卡| 2021久久国自产拍精品| 久久精品国产2020| 久久99九九国产免费看小说| 国内精品久久久久久久涩爱 | 国产精品久久久久蜜芽| 久久本道久久综合伊人| 国产精品久久久99| 久久久综合九色合综国产| 久久香综合精品久久伊人| 国产成人精品综合久久久久| 国内精品久久久久影院薰衣草| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 亚洲精品97久久中文字幕无码| 久久www免费人成精品香蕉| 久久国产成人| 人人狠狠综合久久亚洲高清| 久久久久亚洲国产|