vector-empty

////////////////////////////////////////
//      2018/04/16 9:40:56
//      vector-empty

#include <iostream>
#include <vector>

using namespace std;

int main(){
    vector<int> v;

    cout << "Vector v is ";
    v.empty() ? cout << "" : cout << "not";
    cout << "empty" << endl;

    v.push_back(100);
    cout << "Vector is ";
    v.empty() ? cout << " " : cout << "empty";
    cout << "empty" << endl;

    return 0;
}

/*
OUTPUT:
    Vector v is empty
    Vector is emptyempty
*/
posted @ 2018-04-16 09:55  老耗子  阅读(111)  评论(0编辑  收藏  举报