what's wrong with my solution?
l wrote this solution for No Numeral (Code Coach) and just 2 test failed (test 3,4)! what's wrong with this code?! #include <iostream> #include <cstring> using namespace std; int main() { string s; while (cin>>s){ int n=s.length(); char c[n]; for(int i=0;i<n;i++){ c[i]=s[i]; switch(c[i]){ case '2': cout<<"two"; break; case '3': cout<<"three"; break; case '4': cout<<"four"; break; case '5': cout<<"five"; break; case '6': cout<<"six"; break; case '7': cout<<"seven"; break; case '8': cout<<"eight"; break; case '9': cout<<"nine"; break; case '0': cout<<"zero"; break; } if(c[i]=='1'){ if(s[i+1]=='0') { cout<<"ten"; i++; } else cout<<"one"; } if(c[i]>96 && c[i]<123) cout<<c[i]; } cout<<" "; } return 0; }