fork download
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int i;
  7. bool ans=true;
  8. vector<int> temp;
  9. vector<int> pre;
  10. pre.push_back(0);
  11. // pre.push_back(1);
  12. // pre.push_back(2);
  13. temp.push_back(0);
  14. //for(i=0;i<4;i++)
  15. // temp.push_back(pre[i]);
  16.  
  17. sort(temp.begin(),temp.end());
  18.  
  19. if(temp.size()>1)
  20. {
  21. for(i=0;i<temp.size()-1;i++)
  22. if(temp[i]==temp[i+1])
  23. {
  24. ans=false;
  25. break;
  26. }
  27. }
  28. for(i=0;i<temp.size();i++)
  29. cout<<temp[i]<<" ";
  30. cout<<endl<<ans;
  31. return 0;
  32. }
Success #stdin #stdout 0s 4384KB
stdin
Standard input is empty
stdout
0 
1