• <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"
            執行后
            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 閱讀(180) 評論(0)  編輯 收藏 引用
            <2008年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            常用鏈接

            留言簿(2)

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久人人爽人人人人爽AV | 色婷婷狠狠久久综合五月| 久久久久久久波多野结衣高潮| 亚洲人成无码久久电影网站| 久久精品国产免费观看| 久久不射电影网| 亚洲v国产v天堂a无码久久| 亚洲国产一成人久久精品| 久久这里只有精品首页| 国产欧美久久久精品影院| 99久久人妻无码精品系列| 久久露脸国产精品| 成人国内精品久久久久一区| 久久青青草原精品国产软件| 久久精品国产久精国产思思| 欧美久久久久久精选9999| 久久99精品国产| 亚洲级αV无码毛片久久精品| www亚洲欲色成人久久精品| 中文无码久久精品| 亚洲精品tv久久久久| 免费国产99久久久香蕉| 欧美va久久久噜噜噜久久| 久久久高清免费视频| 久久精品国产72国产精福利| 国产V综合V亚洲欧美久久| 亚洲愉拍99热成人精品热久久| 久久国产成人午夜aⅴ影院| 久久天堂电影网| 日日噜噜夜夜狠狠久久丁香五月| 性做久久久久久久久| 深夜久久AAAAA级毛片免费看| 久久线看观看精品香蕉国产| 久久精品一区二区| 久久精品www人人爽人人| 国产精品乱码久久久久久软件| 欧美午夜A∨大片久久 | 久久国产亚洲精品| 人妻丰满?V无码久久不卡| 久久久久18| 波多野结衣久久|