• <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)

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            日本亚洲色大成网站WWW久久| 一本综合久久国产二区| 亚洲国产精品无码久久久蜜芽| 伊人久久五月天| 日本久久久久亚洲中字幕| 国产精品久久久久AV福利动漫| 99久久精品免费| 77777亚洲午夜久久多人| 97久久精品无码一区二区| 国产精品热久久毛片| 无码AV波多野结衣久久| 91精品日韩人妻无码久久不卡| 色青青草原桃花久久综合| 久久免费精品视频| 久久WWW免费人成一看片| 精品久久久久久无码国产| 亚洲∧v久久久无码精品| 色天使久久综合网天天| 青青草原综合久久| 日韩乱码人妻无码中文字幕久久| 久久久这里有精品中文字幕| 久久国产精品无码一区二区三区 | 久久99国产一区二区三区| 一本色道久久综合狠狠躁| 精品久久久久中文字| 国产精品久久成人影院| 人妻精品久久无码专区精东影业| 伊人久久大香线蕉AV一区二区| 久久se精品一区二区影院| 久久精品九九亚洲精品天堂 | 日日狠狠久久偷偷色综合0| 久久久久久久综合日本亚洲| 久久精品中文字幕一区| 久久久久亚洲AV成人网人人网站| 久久久国产精品| 中文字幕无码av激情不卡久久| 久久精品国产第一区二区| 国产69精品久久久久99| 狠狠人妻久久久久久综合| 久久精品国产一区二区电影| 国产精品美女久久久久av爽|