Playground
#include <iostream> #include <vector> #include <set> using namespace std; int main() { int arr[] = {1, 3, 7, 6, 3, 4, 7}; vector<int> v(arr, arr+7); //v={1, 3, 7, 6, 3, 4, 7} set<int> s(v.begin(), v.end()); //s={1, 3, 4, 6, 7} vector<int> v2(s.begin(), s.end()); //v2={1, 3, 4, 6, 7} cout << v2.size() << endl; //pechati '5' return 0; }
Input data
Program output
no input
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!