#include <iostream>
#include <string>
using namespace std;
bool isb(char t)
{
bool f=false;
string dic="abcdefghijklmnopqrstuvwxyz1234567890";
for(int i=0;i<dic.size();i++)
if(dic[i]==t)
return !f;
return f;
}
int main()
string s;
int i=0;
getline(cin,s);
while(i<s.size())
if(isb(s[i]))
s.insert(i,1,s[i]);
i++;
cout<<s<<endl;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
#include <iostream>
#include <string>
using namespace std;
bool isb(char t)
{
bool f=false;
string dic="abcdefghijklmnopqrstuvwxyz1234567890";
for(int i=0;i<dic.size();i++)
if(dic[i]==t)
return !f;
return f;
}
int main()
{
string s;
int i=0;
getline(cin,s);
while(i<s.size())
{
if(isb(s[i]))
{
s.insert(i,1,s[i]);
i++;
}
i++;
}
cout<<s<<endl;
return 0;
}