vector-empty

0人阅读 评论(0) 收藏 举报
分类:
////////////////////////////////////////
//      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
*/
查看评论
    个人资料
    持之以恒
    等级:
    访问量: 4万+
    积分: 1714
    排名: 2万+
    xxxxx