精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • 假設(shè)兩線性表LA和LB分別表示兩集合A和B,要求新集合A=A并B.

    假設(shè)兩線性表LA和LB分別表示兩集合A和B,要求新集合A=A并B.
    數(shù)據(jù)輸入:
    \x05
    \x05由文件input.txt 給出輸入數(shù)據(jù).第1 行為集合A的元素,第二行為集合B元素.
    \x05結(jié)果輸出:
    \x05
    \x05將計(jì)算出的合并后的新集合A中元素輸出到文件output.txt.
    \x05
    輸入文件示例 輸出文件示例
    \x05輸入文件范例 輸出文件范例
    \x05input.txt output.txt
    \x052 6 3 9 8 6 2 6 3 9 8 6 5
    其他人氣:971 ℃時間:2020-04-15 11:58:22
    優(yōu)質(zhì)解答
    #include
    #include
    #include
    #include
    using namespace std;
    int main()
    {
    int a[]={1,5,8,12,5,-5,32};
    int b[]={3,5,1,-3,10};
    list< int > set1(a,a+sizeof(a)/sizeof(int));
    list< int > set2(b,b+sizeof(b)/sizeof(int));
    list< int > result;
    set1.sort();
    set2.sort();
    //交集
    set_intersection(set1.begin(),set1.end(),set2.begin(),set2.end(),back_inserter(result));
    copy(result.begin(),result.end(),ostream_iterator< int >(cout," "));
    cout
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版