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

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久只这里是精品66| 久久精品国产网红主播| 亚洲狠狠综合久久| 久久综合久久综合久久| 人人狠狠综合久久亚洲| 久久天天婷婷五月俺也去 | 国产日产久久高清欧美一区| 国产精品美女久久久久网| 国产精品伦理久久久久久 | 2022年国产精品久久久久| 亚洲国产精品久久久久婷婷老年| 久久久91人妻无码精品蜜桃HD| 亚洲精品无码久久不卡| 成人综合伊人五月婷久久| 伊色综合久久之综合久久| 99国产欧美精品久久久蜜芽 | 亚洲欧美另类日本久久国产真实乱对白| 精品综合久久久久久98| 狠狠人妻久久久久久综合蜜桃| 欧美日韩精品久久免费| 久久久久久噜噜精品免费直播| 国内精品久久久久影院一蜜桃| 亚洲国产精品综合久久网络| 9191精品国产免费久久| 97久久香蕉国产线看观看| 中文字幕人妻色偷偷久久| 久久久久国色AV免费看图片| 久久国产乱子伦精品免费强| 蜜臀av性久久久久蜜臀aⅴ麻豆| 亚洲国产成人精品无码久久久久久综合| 久久精品人成免费| 亚洲精品乱码久久久久久| 精品久久久久成人码免费动漫| 久久久久亚洲AV综合波多野结衣| 日本免费一区二区久久人人澡 | 久久精品国产精品国产精品污| 东方aⅴ免费观看久久av| 精品熟女少妇AV免费久久| 女人高潮久久久叫人喷水| 久久天天躁狠狠躁夜夜avapp| 2020久久精品亚洲热综合一本|