#include<bits/stdc++.h>
using namespace std;
setss;
void ascii_subs(string in ,string out)
{
if (in.size()==1)
{
ss.insert(out);
ss.insert(out+in);
int av=in[0];
ss.insert(out + to_string(av));
return;
}
ascii_subs(in.substr(1),out);
ascii_subs(in.substr(1),out + in[0]);
ascii_subs(in.substr(1),out+ to_string((int)in[0]));
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie();
string inn;
cin>>inn;
ascii_subs(inn,"");
cout<<ss.size()<<endl;
copy(ss.begin(),ss.end(),ostream_iterator(cout," "));
}
Is the logic wrong, hints req!!