No Numerals Chellenge , i can't pass the 3rd condition with this code
#include <iostream> #include <string> using namespace std; int main() { string input,word,output; getline(cin,input); for(int x = 0;input[x] != '\0';x++){ word += input[x]; if(input[x+1] == ' '||input[x+1] == '\0'){ if(word == "0"){ word = "zero"; } if(word == "1"){ word = "one"; } if(word == "2"){ word = "two"; } if(word == "3"){ word = "three"; } if(word == "4"){ word = "four"; } if(word == "5"){ word = "five"; } if(word == "6"){ word = "six"; } if(word == "7"){ word = "seven"; } if(word == "8"){ word = "eight"; } if(word == "9"){ word = "nine"; } if(word == "10"){ word = "ten"; } output += word + ' '; word = ""; x++; } } cout<<output; return 0; }