vector-empty

版权声明:我是一只快乐的小妖精 https://blog.csdn.net/qwq1503/article/details/79956727
////////////////////////////////////////
//      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
*/
阅读更多

扫码向博主提问

小小妖妖

非学,无以致疑;非问,无以广识
去开通我的Chat快问
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页