I tried doing this to enter the characters of my string into a set but this is throwing an error.
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
set<string> my;
set<string>::iterator it;
cin>>s;
int n=s.length();
for(int i=0;i<n;i++)
{
char c=s[i];
my.insert(c);
}
}
How can i enter the characters of the string into set.
Aucun commentaire:
Enregistrer un commentaire