c++ primer 练习5.17

来源:互联网 发布:深圳 知乎 编辑:程序博客网 时间:2024/06/10 03:11
/*** c++ primer 5.17***/#include <iostream>  #include <vector>  using namespace std;    int main()  {      vector<int> vint1 = {0,1,2,3,4,5}, vint2 = {0,1,2,3,4,5,6,7,8,11,12,113};    decltype(vint1.size()) i = 0, sz = vint1.size();    for (; i != sz && vint1[i] == vint2[i]; ++i) {        ;    }    if (i == sz) {        cout << "True" << endl;    } else {        cout << "False" << endl;    }    return 0;}


0 0
原创粉丝点击