1144 The Missing Number (20 分)

水~。

set<int> S;
int n;

int main()
{
    cin>>n;

    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        if(x > 0) S.insert(x);
    }

    int res=1;
    while(S.count(res)) res++;
    cout<<res<<endl;
    //system("pause");
    return 0;
}
原文地址:https://www.cnblogs.com/fxh0707/p/14482756.html