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

            隨筆檔案

            文章檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久人人爽人人爽人人片AV不 | 久久久久国色AV免费观看| 久久精品一区二区三区不卡| 国产亚洲精久久久久久无码AV| 久久天天躁狠狠躁夜夜不卡| 亚洲αv久久久噜噜噜噜噜| 亚洲午夜久久影院| 久久婷婷五月综合色奶水99啪| 国产精品一区二区久久精品无码| 久久久久99这里有精品10 | 色青青草原桃花久久综合| jizzjizz国产精品久久| 亚洲中文字幕无码久久2020| 久久亚洲国产成人影院网站| 97久久精品人妻人人搡人人玩| 中文字幕无码av激情不卡久久| 青青草原综合久久| 久久精品亚洲一区二区三区浴池| 欧美一级久久久久久久大片| 亚洲天堂久久精品| 热久久这里只有精品| 久久96国产精品久久久| 99精品国产在热久久无毒不卡| 亚洲综合精品香蕉久久网| 久久这里只有精品首页| 久久精品国产精品亚洲下载| 国产精品美女久久久久AV福利| 久久综合国产乱子伦精品免费| 欧洲人妻丰满av无码久久不卡| 99久久夜色精品国产网站 | 久久国产精品久久国产精品| 久久精品国产亚洲av水果派| 日韩AV无码久久一区二区| 亚洲AV无码成人网站久久精品大| 色婷婷综合久久久久中文| 亚洲AV日韩精品久久久久| 久久亚洲精品国产精品| 国产精品久久久久jk制服| 久久精品国内一区二区三区| 免费国产99久久久香蕉| 久久国产精品一区|