So the problem states that I have to input an array of unsorted elements containing duplicates and I decided to use sort. I am new to this and I don't understand the error
I'm trying to run it on GFG's IDE.
#include <iostream>
#include <bits/stdc++.h>
int main() {
//code
int n,size,a;
cin>>n;
while(n--)
{
cin>>size;
int a[size];
set<int> s;
for(int i=0;i<size;i++)
{
cin>>a;
s.insert(a);
}
for(int i=s.begin();i!=s.end();i++)
cout<<i<<" ";
return 0;
}
Error message:
no match for 'operator>>' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'int [size]')
cin>>a;