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

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            人妻少妇久久中文字幕 | 国产精品18久久久久久vr | 久久综合狠狠综合久久激情 | 国产精品禁18久久久夂久| 久久精品国产亚洲av麻豆色欲| yellow中文字幕久久网| 久久久综合香蕉尹人综合网| 久久久久久久久波多野高潮| 久久青青草原亚洲av无码app| 日本免费一区二区久久人人澡| 久久伊人精品青青草原日本| 久久精品天天中文字幕人妻| 精品国产一区二区三区久久蜜臀| 久久精品国产2020| 精品久久久久久国产牛牛app| 热99RE久久精品这里都是精品免费| 国产亚洲精品美女久久久| 欧美日韩中文字幕久久久不卡 | 久久久久国产精品麻豆AR影院| 久久精品国产亚洲AV蜜臀色欲 | 成人综合伊人五月婷久久| 久久99精品国产麻豆婷婷| 欧美熟妇另类久久久久久不卡| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 日韩亚洲国产综合久久久| 成人久久综合网| 久久精品国产亚洲AV无码偷窥| 久久伊人影视| 亚洲国产成人精品无码久久久久久综合 | 亚洲欧美一级久久精品| 国产精品久久久福利| 日日躁夜夜躁狠狠久久AV| 亚洲日本久久久午夜精品| 久久久WWW成人| 色综合久久中文字幕综合网| 理论片午午伦夜理片久久 | 久久精品一区二区三区中文字幕 | 精品久久久无码21p发布| 久久99国产精品久久99小说| 久久久中文字幕日本| 伊人久久亚洲综合影院|