• <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>
            posts - 21,  comments - 20,  trackbacks - 0
            #include "stdafx.h"
            #include 
            <iostream>
            #include 
            <fstream>
            #include 
            <iterator>
            #include 
            <algorithm>
            #include 
            <vector>
            #include 
            <string>

            using namespace std;

            int main()
            {
                ifstream in_file( 
            "input_file.txt" );
                ofstream out_file( 
            "output_file.txt" );
                
                
            if ( ! in_file || ! out_file )
                
            {
                     cerr
            <<"!!unable to open the necessary files.\n";
                     
            return -1;
                }

                
                istream_iterator
            < string > is( in_file );
                istream_iterator
            < string > eof;
                
                vector 
            < string > text;
                copy( 
            is, eof, back_inserter( text ));
                
                sort( text.begin(), text.end() );
                
                ostream_iterator
            < string > os( out_file," " );
                copy( text.begin(), text.end(), os );
            }
            代碼如上,是<<Essential C++>>中的一段
            input_file的內容為"7 956 1 5 147 3 78 24 87 62 45 12 77 86 64 52 58 74"
            執(zhí)行后
            output_file中內容為"1 12 147 24 3 45 5 52 58 62 64 7 74 77 78 86 87 956"

            - -
            sort()對字符串排序...shit...只認首字符
            posted on 2008-07-19 12:36 Niino 閱讀(177) 評論(0)  編輯 收藏 引用
            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            常用鏈接

            留言簿(2)

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            国产精品一久久香蕉国产线看 | 国产免费福利体检区久久| 久久九九亚洲精品| 色诱久久av| 久久国产成人精品麻豆| 久久亚洲国产精品五月天婷| 久久天天躁狠狠躁夜夜躁2014| 99精品久久久久中文字幕| 久久精品国产黑森林| 久久综合狠狠综合久久| 国内精品久久久久久中文字幕 | 亚洲国产精品热久久| 91麻豆国产精品91久久久| 99久久国产主播综合精品| 久久亚洲AV成人无码| 久久久久人妻一区精品果冻| 色婷婷综合久久久久中文| 亚洲伊人久久成综合人影院 | 久久久久国产一区二区 | 久久伊人五月天论坛| WWW婷婷AV久久久影片| 久久久久久精品免费免费自慰| 久久久久免费精品国产| 久久夜色精品国产网站| 精品国产乱码久久久久久呢| 久久精品?ⅴ无码中文字幕| 色综合色天天久久婷婷基地| 亚洲精品乱码久久久久66| 中文成人无码精品久久久不卡| 国产精品久久久久乳精品爆| www.久久99| 久久精品免费观看| 国产精品久久久久久福利69堂| 97久久国产综合精品女不卡 | 久久久久久国产精品无码下载| 久久久久成人精品无码| 久久免费视频6| 无码人妻久久一区二区三区蜜桃| 国产精品无码久久久久| 久久精品国产清自在天天线| 国产三级精品久久|