24th Mar 2022, 9:21 PM
Mohammed
3 Answers
+ 1
for(int i=0; i<l; i++){ if(isdigit(str[i])){ string s; s+=str[i]; cout<<arr[stoi(s)]; continue; } cout<<str[i]; } //string argument needed so convert to string.. //hope it helps...
24th Mar 2022, 9:32 PM
Jayakrishna 🇼🇳
+ 4
// or this code string s; for(int i=0; i<l; i++) if(isdigit(str[i])) s+=arr[stoi(&str[i])]; else s+=str[i]; cout<<s;
24th Mar 2022, 10:08 PM
SoloProg
SoloProg - avatar