• <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>
            /*  讀入一串字符(j個數,一行,間隔空格,輸入完回車),按空
            格(可間隔任意個)截斷為j個數字并用數組(長度剛好)存儲他們
            */
            /*  c++終結版 VS和DEV-C++編譯通過 */
            #include <iostream>
            #include <vector>
            #include <string>
            #include <sstream>
            using namespace std;
            int main()
            {
                string line;
                int num;
                vector<int> nums;
                getline(cin,line);
                istringstream stream(line);
                while(stream>>num)
                    nums.push_back(num);
                for(vector<int>::iterator iter=nums.begin();iter!=nums.end();++iter)
                    cout<<*iter<<" ";cout<<endl;
                system("pause");
            }


            /*讀入一行數c++精簡版
            #include <iostream>
            #include <vector>
            using namespace std;
            int main()
            {
                int temp;
                vector<int> nums;
                while(cin>>temp&&getchar()!='\n')/*弊病:輸入的末尾不可以是空格*/
                    nums.push_back(temp);
                nums.push_back(temp);
                for(vector<int>::iterator iter=nums.begin();iter!=nums.end();++iter)
                    cout<<*iter<<" ";
                system("pause");  
            }
            */

            Posted on 2007-07-22 15:49 小王子 閱讀(2172) 評論(0)  編輯 收藏 引用 所屬分類: 分類1:C++文章
            久久这里只有精品久久| 精品久久久久久无码中文字幕| 精品水蜜桃久久久久久久| 欧美亚洲国产精品久久| 久久久久久亚洲精品成人| 久久国产视屏| 久久久久久亚洲精品成人| 人妻少妇精品久久| 欧美亚洲国产精品久久蜜芽| 精品久久久久成人码免费动漫| 久久这里只精品国产99热| 免费精品久久天干天干| 成人精品一区二区久久| 日韩av无码久久精品免费| 精品多毛少妇人妻AV免费久久| 777米奇久久最新地址| 国色天香久久久久久久小说| 久久久99精品一区二区| 久久久久四虎国产精品| 日韩人妻无码精品久久免费一| 午夜精品久久久久久影视777| 亚洲国产成人久久综合一 | 久久久青草久久久青草| 久久无码高潮喷水| 久久国产亚洲精品| 欧美国产精品久久高清| 久久久久国色AV免费观看| 久久久青草青青亚洲国产免观| 久久天天躁狠狠躁夜夜躁2O2O| 伊人久久大香线蕉av一区| 久久久久亚洲精品日久生情 | 日本欧美久久久久免费播放网| 色偷偷88欧美精品久久久| 久久久久久一区国产精品| 久久久国产精品| 国内精品久久久久影院网站| 中文字幕亚洲综合久久2| 国产综合精品久久亚洲| 久久精品综合一区二区三区| 伊人久久免费视频| 久久久久亚洲精品无码网址 |