fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n = 5;
  6. vector<int> a(n);
  7. set<int> b;
  8. for(int i = 0;i < n;++i){
  9. cin>>a[i];
  10. b.insert(a[i]);
  11. }
  12. vector<int> bb(b.begin(),b.end());
  13. if((int)bb.size() >= 2)
  14. cout<<bb[1];
  15. return 0;
  16. }
Success #stdin #stdout 0s 5252KB
stdin
Standard input is empty
stdout
Standard output is empty