Problem in code coach problem....No Numeral
I am stuck in it for 2 days almost but couldn't figure out the ambiguity đđ. #include <iostream> #include <string> #include <vector> #include <cctype> using namespace std; int main() { vector<string> words{ "zero","one","two","three", "four","five","six","seven", "eight","nine","ten" }; vector<char> result{}; string sentence{}; getline(cin, sentence ); for(size_t i{0};i<sentence.length();i++){ if(isdigit(sentence[i]) && !(isdigit(sentence[i+1]))){ int n=sentence[i]-'0'; for(size_t j{0};j<words[n].length();j++){ result.push_back(words[n][j]); } }else if(isalpha(sentence[i]) || isspace(sentence[i])){ result.push_back(sentence[i]); }else if(sentence[i]=='1' && sentence[i+1]=='0'){ for(size_t k{0};k<3;k++){ result.push_back(words[10][k]); } } } for(char c: result ) cout<<c; cout<<endl; return 0; }