• <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的內(nèi)容為"7 956 1 5 147 3 78 24 87 62 45 12 77 86 64 52 58 74"
            執(zhí)行后
            output_file中內(nèi)容為"1 12 147 24 3 45 5 52 58 62 64 7 74 77 78 86 87 956"

            - -
            sort()對字符串排序...shit...只認(rèn)首字符
            posted on 2008-07-19 12:36 Niino 閱讀(182) 評論(0)  編輯 收藏 引用

            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            <2008年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            常用鏈接

            留言簿(2)

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            一级A毛片免费观看久久精品| 欧美一区二区三区久久综合| 久久精品国产一区二区三区不卡| 久久精品一区二区影院| 婷婷综合久久中文字幕蜜桃三电影| 国产欧美久久一区二区| 综合久久国产九一剧情麻豆| 26uuu久久五月天| 97久久国产亚洲精品超碰热| 久久中文字幕无码专区| 国产精品VIDEOSSEX久久发布| 亚洲中文字幕无码久久精品1| 久久免费观看视频| 国内精品久久久久久久影视麻豆| 色婷婷综合久久久久中文一区二区| 国产亚洲美女精品久久久| 狠狠色丁香久久综合五月| 精品国产青草久久久久福利| 亚洲精品成人网久久久久久| 久久青青草原精品国产软件| 久久综合久久综合九色| 久久久精品一区二区三区| …久久精品99久久香蕉国产| 国产成人久久精品一区二区三区 | 欧美一区二区精品久久| 奇米影视7777久久精品| 日韩精品久久无码中文字幕 | 久久婷婷五月综合97色| 久久影院综合精品| 久久精品99久久香蕉国产色戒| 国产精品乱码久久久久久软件| 伊人久久国产免费观看视频 | 2021最新久久久视精品爱| 久久久久久久免费视频| 2021国产精品久久精品| 一本色道久久88精品综合| 少妇高潮惨叫久久久久久| 日本人妻丰满熟妇久久久久久| 婷婷综合久久中文字幕蜜桃三电影| 亚洲AV无码1区2区久久| 久久亚洲国产精品一区二区|