note
1) The symbols like {,[<@ are not characters, so they can't be stored in string.
2) If you need to enter the some elements in vector or set and you don't know the number of elements tha follow:
ex for integers;
set <int> a;
char b;
while(cin>>b)
{
if(any condition if you need)
a.insert(b);
}
if you now the number of elements
set <int> a;
char b;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
if(any condition if you need)
a.insert(b);
}
Comments
Post a Comment