亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? alg2.cpp

?? test program for STL generic algorithm that search for elements that satisfy a condition
?? CPP
字號:
#include "stlexam.h"
#pragma hdrstop
/**************************************************************************
 *
 * alg2.cpp - test program for STL generic algorithm that search for 
 *    elements that satisfy a condition.  Section 12.3
 *
 ***************************************************************************
 *
 * (c) Copyright 1994, 1998 Rogue Wave Software, Inc.
 * ALL RIGHTS RESERVED
 *
 * The software and information contained herein are proprietary to, and
 * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
 * intends to preserve as trade secrets such software and information.
 * This software is furnished pursuant to a written license agreement and
 * may be used, copied, transmitted, and stored only in accordance with
 * the terms of such license and with the inclusion of the above copyright
 * notice.  This software and information or any other copies thereof may
 * not be provided or otherwise made available to any other person.
 *
 * Notwithstanding any other lease or license that may pertain to, or
 * accompany the delivery of, this computer software and information, the
 * rights of the Government regarding its use, reproduction and disclosure
 * are as set forth in Section 52.227-19 of the FARS Computer
 * Software-Restricted Rights clause.
 * 
 * Use, duplication, or disclosure by the Government is subject to
 * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
 * Technical Data and Computer Software clause at DFARS 252.227-7013.
 * Contractor/Manufacturer is Rogue Wave Software, Inc.,
 * P.O. Box 2328, Corvallis, Oregon 97339.
 *
 * This computer software and information is distributed with "restricted
 * rights."  Use, duplication or disclosure is subject to restrictions as
 * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
 * Computer Software-Restricted Rights (April 1985)."  If the Clause at
 * 18-52.227-74 "Rights in Data General" is specified in the contract,
 * then the "Alternate III" clause applies.
 *
 **************************************************************************/

#include <vector>
#include <list>
#include <algorithm>
#include <ctype.h>
#include <string>
#include <string.h>

#ifdef _RW_STD_IOSTREAM
#include <iostream>
#else
#include <iostream.h>
#endif

#ifndef _RWSTD_NO_NAMESPACE
using namespace std;
#endif

int randomInteger (int m) {   return rand() % m; }

bool isLeapYear (unsigned int year)
{
    if (year % 1000 == 0)
        return true;
    if (year % 100 == 0)
        return false;
    if (year % 4 == 0)
        return true;
    return false;
}


void split (const string & text, const string & separators,
            list<string,allocator<string> > & words)
{
    int n     = text.length();
    int start = text.find_first_not_of(separators);

    while ((start >= 0) && (start < n))
    {
        int stop = text.find_first_of(separators, start);
        if ((stop < 0) || (stop > n)) stop = n;
        words.push_back (text.substr(start, stop-start));
        start = text.find_first_not_of(separators, stop+1);
    }
}

//
// Illustrate use of the find function.
//

void find_test ()
{
    cout << "Test of algorithm find" << endl;

    int vintageYears[] = { 1967, 1972, 1974, 1980, 1995 };

    vector<int,allocator<int> >::iterator start = vintageYears;
    vector<int,allocator<int> >::iterator stop  = vintageYears + 5;
    
    vector<int,allocator<int> >::iterator where = find_if(start, stop, isLeapYear);
    
    if (where != stop)
        cout << "first vintage leap year is " << *where << endl;
    else
        cout << "no vintage leap years" << endl;
        
    where = find(start, stop, 1995);
    
    if (where != stop)
        cout << "1995 is position " << where - start << " in sequence" << endl;
    else
        cout << "1995 does not occur in sequence" << endl;
}

void find_adjacent_test ()
{
    cout << "Test of algorithm find adjacent" << endl;

    char * text = "The bookkeeper carefully opened the door";
    
    vector<char,allocator<char> >::iterator start = text;
    vector<char,allocator<char> >::iterator stop = text + strlen(text);
    
    vector<char,allocator<char> >::iterator where = start;
    
    cout << "In the text " << text << endl;

    while ((where = adjacent_find(where, stop)) != stop)
    {
        cout << "double " << *where << " in position " << where-start << endl;
        ++where;
    }
}

//
// Illustrate the use of the search function.
//

void search_test ()
{
    cout << "Test of algorithm search" << endl;

    char * base = "aspirations";
    char * text = "ration";
    
    char * where = search(base, base+strlen(base), text, text+strlen(text));
    
    if (*where != '\0')
        cout << "substring begins in position " << where - base << endl;
    else
        cout << "substring does not occur in text" << endl;
}

//
// Illustrate use of max_element and min_element algorithms.
//

void max_min_example ()
{
    cout << "Test of max and min algorithms " << endl;
    //
    // Make a vector of random numbers between 0 and 99.
    //
    vector<int,allocator<int> > numbers(25);
    for (int i = 0; i < 25; i++)
        numbers[i] = randomInteger(100);
    //
    // Print the maximum.
    //
    vector<int,allocator<int> >::iterator max = max_element(numbers.begin(), numbers.end());
    cout << "largest value was " << *max << endl;
    //
    // Example using strings.
    //
    string text = "it was the best of times, it was the worst of times.";
    list<string,allocator<string> >words;
    split(text, " .,!:;", words);
    cout << "The smallest word is "
        << * min_element(words.begin(), words.end())
        << " and the largest word is "
        << * max_element(words.begin(), words.end())
        << endl;
}

//
// Illustrate the use of the mismatch function.
//

void mismatch_test (char * a, char * b) 
{
    pair<char *, char *> differPositions(0, 0);
    char * aDiffPos;
    char * bDiffPos;

    if (strlen(a) < strlen(b))
    {
        differPositions = mismatch(a, a + strlen(a), b);
        aDiffPos = differPositions.first;
        bDiffPos = differPositions.second;
    }
    else
    {
        differPositions = mismatch(b, b + strlen(b), a);
        aDiffPos = differPositions.second;
        bDiffPos = differPositions.first;
    }
        
    cout << "string " << a;

    if (*aDiffPos == *bDiffPos)
        cout << " is equal to ";
    else if (*aDiffPos < *bDiffPos)
        cout << " is less than ";
    else
        cout << " is greater than ";

    cout << b << endl;
}

int main ()
{
    cout << "STL generic algorithms -- Searching Algorithms" << endl;

    find_test();
    find_adjacent_test();
    search_test();
    max_min_example();
    mismatch_test("goody", "goody");
    mismatch_test("good", "goody");
    mismatch_test("goody", "good");
    mismatch_test("good", "fred");
    mismatch_test("fred", "good");
    
    cout << "End of search algorithms test program" << endl;

    return 0;
}










?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性三三影院| 另类小说图片综合网| 99国产精品久| 国产精品久久久久久久久晋中| 国产suv精品一区二区883| 中文字幕av资源一区| 99久久精品免费| 亚洲国产色一区| 欧美一卡在线观看| 国产永久精品大片wwwapp| 中文字幕av资源一区| 91网站最新地址| 婷婷中文字幕一区三区| 精品美女在线播放| 成人精品视频一区二区三区尤物| 亚洲精品久久久蜜桃| 91精品国产欧美日韩| 国产成人av电影在线观看| 亚洲人精品一区| 在线播放91灌醉迷j高跟美女| 精品无码三级在线观看视频 | 日韩精品色哟哟| 精品对白一区国产伦| 成年人网站91| 日韩电影免费在线看| 中文字幕成人在线观看| 欧美日韩国产123区| 天堂精品中文字幕在线| 国产亚洲精品超碰| 国产精品天美传媒沈樵| 色婷婷久久综合| 麻豆久久久久久久| 成人欧美一区二区三区小说| 欧美高清性hdvideosex| 成人免费视频app| 日本不卡一区二区| 国产精品久久久久久妇女6080 | 老司机免费视频一区二区三区| 中文字幕免费一区| 欧美一二三区精品| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩国产精品大片| 成人欧美一区二区三区1314 | 色老头久久综合| 国产永久精品大片wwwapp | 欧美视频一区二区在线观看| 久久99精品一区二区三区三区| 亚洲欧美aⅴ...| 久久夜色精品国产噜噜av| 欧美私人免费视频| av一区二区不卡| 国产在线精品一区在线观看麻豆| 亚洲成人在线网站| 国产精品大尺度| 久久综合久久99| 欧美巨大另类极品videosbest | 日韩精品欧美精品| 亚洲综合一二三区| 国产精品全国免费观看高清| 精品国产成人在线影院| 欧美伊人久久大香线蕉综合69| 成人免费观看男女羞羞视频| 黑人巨大精品欧美黑白配亚洲| 香蕉影视欧美成人| 一卡二卡三卡日韩欧美| 国产精品女主播av| 欧美zozo另类异族| 欧美一级理论性理论a| 在线视频一区二区三区| 91网页版在线| 不卡免费追剧大全电视剧网站| 久久er99精品| 久热成人在线视频| 麻豆精品在线视频| 久久国产尿小便嘘嘘| 日本怡春院一区二区| 亚洲成人激情自拍| 偷拍与自拍一区| 亚洲不卡av一区二区三区| 亚洲一区二区三区四区五区中文 | 亚洲免费电影在线| 亚洲欧洲精品一区二区精品久久久| 久久久99免费| 国产精品网曝门| 成人欧美一区二区三区视频网页| 国产精品国产三级国产aⅴ中文 | 666欧美在线视频| 日韩一区二区在线观看视频 | jlzzjlzz亚洲女人18| 成人综合在线网站| 99免费精品视频| 色乱码一区二区三区88 | 欧美性猛片aaaaaaa做受| 欧美午夜一区二区三区免费大片| 欧美亚洲高清一区二区三区不卡| 欧洲av一区二区嗯嗯嗯啊| 欧美日免费三级在线| 欧美一区二区三区免费在线看| 日韩一级片网站| 国产清纯白嫩初高生在线观看91| 国产精品久久久久久久久动漫| 综合久久久久综合| 亚洲图片欧美一区| 久久99国产精品免费网站| 国产成人免费视频精品含羞草妖精| 成人性生交大片免费看视频在线| 99国产精品久久久久| 欧美日韩精品一区二区三区四区 | 国产成人免费xxxxxxxx| 成人av在线播放网址| 在线日韩av片| 欧美变态凌虐bdsm| 国产精品高清亚洲| 亚洲电影你懂得| 国产美女久久久久| 日本精品一级二级| 精品日韩av一区二区| 国产精品第四页| 秋霞国产午夜精品免费视频| 国产成人精品综合在线观看 | 日本伦理一区二区| 久久综合久久99| 一区二区三区成人| 九色综合国产一区二区三区| 91年精品国产| 欧美成人国产一区二区| 亚洲乱码国产乱码精品精的特点| 美日韩一区二区| 在线精品视频一区二区| 久久久久久久免费视频了| 亚洲大片在线观看| 成人国产精品免费网站| 日韩一二三区视频| 亚洲天堂a在线| 韩国视频一区二区| 欧美人妖巨大在线| 亚洲丝袜自拍清纯另类| 国产主播一区二区三区| 欧美日韩国产中文| 自拍av一区二区三区| 国产麻豆精品视频| 欧美一区二区三区免费| 一区二区三区精品久久久| 成人午夜激情视频| 久久综合五月天婷婷伊人| 日韩国产欧美在线播放| 色婷婷久久久久swag精品| 日本一二三不卡| 久久99国产精品麻豆| 欧美一二三区在线| 日韩和欧美一区二区| 欧洲色大大久久| 亚洲精品日韩一| av一区二区不卡| 国产精品拍天天在线| 国产91精品精华液一区二区三区 | 欧美在线你懂得| ●精品国产综合乱码久久久久 | 午夜精品免费在线| 91久久国产综合久久| 国产精品美日韩| 国产91露脸合集magnet| 久久天天做天天爱综合色| 九色|91porny| 精品嫩草影院久久| 九色综合狠狠综合久久| 欧美xxxx在线观看| 久久精品国产精品亚洲红杏| 制服视频三区第一页精品| 天天av天天翘天天综合网 | 成人午夜精品一区二区三区| 国产三区在线成人av| 国产成人av电影在线观看| 国产视频在线观看一区二区三区| 精品亚洲aⅴ乱码一区二区三区| 欧美xxxxx牲另类人与| 理论电影国产精品| 精品精品国产高清a毛片牛牛| 老司机免费视频一区二区| 久久夜色精品一区| 丁香激情综合五月| 亚洲欧美色图小说| 欧美日韩一区在线观看| 亚洲成人福利片| 日韩女优毛片在线| 国产成人欧美日韩在线电影| 国产精品三级在线观看| 色悠悠久久综合| 亚洲成a人片综合在线| 日韩一级欧美一级| 国产黄色91视频| 亚洲欧美激情小说另类| 欧美猛男超大videosgay| 久久精品国产成人一区二区三区 | 久久久国产精华| zzijzzij亚洲日本少妇熟睡| 亚洲激情网站免费观看| 欧美一区二区精品| 成人午夜精品在线| 婷婷久久综合九色国产成人|