• <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...只認首字符
            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)

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            亚洲精品美女久久久久99| 久久亚洲美女精品国产精品| 97久久精品无码一区二区天美| 精品久久人妻av中文字幕| 久久久久国产| 亚洲国产精品无码久久| 国产精品对白刺激久久久| 99久久精品国产综合一区| 国产69精品久久久久久人妻精品| 粉嫩小泬无遮挡久久久久久| 日本一区精品久久久久影院| 久久w5ww成w人免费| 国产欧美久久久精品影院| 国内精品久久久久国产盗摄| 国产精品久久久久久搜索| 久久精品国产亚洲AV不卡| 亚洲AV无码久久寂寞少妇| 国产69精品久久久久9999| 88久久精品无码一区二区毛片 | 欧美日韩中文字幕久久久不卡| 久久九九青青国产精品| 久久人妻少妇嫩草AV蜜桃| 国产精品成人久久久| 久久中文娱乐网| 久久综合给合久久狠狠狠97色69| 日韩电影久久久被窝网| 久久久WWW成人免费毛片| 国产一级做a爰片久久毛片| 久久精品国产亚洲欧美| 奇米综合四色77777久久| 久久精品国产免费观看| 亚洲国产成人久久笫一页| 亚洲人成网站999久久久综合| 亚洲级αV无码毛片久久精品| 国产精品国色综合久久| 狠狠色狠狠色综合久久| 99久久香蕉国产线看观香| 欧洲国产伦久久久久久久| 久久艹国产| 久久综合九色综合欧美就去吻| 国产精品久久久久久影院|