while ((N–)!=0 && cin>>input)
multiset1.insert(input);
Here is the accepted one,For the multiset
Take a look below.
#include < iostream >
#include < set >
using namespace std;
int main()
{
multiset< int >multiset1;
int N,i;
cin>>N;
int input;
while((N--)!=0 && cin>>input)
{
multiset1.insert(input);
}
multiset<int>::iterator itr = multiset1.begin();
while (itr != multiset1.end())
{
cout << *itr++ << endl;
}
return 0;
}
For Given N value:
```
3 -> Given N value
1
2
3
Printing Elements in multiset1.
1
2
3
```