You are viewing a single comment's thread. Return to all comments →
string number_name[10]= { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "Greater than 9" }; string n_temp; getline(cin, n_temp); int n = stoi(ltrim(rtrim(n_temp))); // Write your code here int idx = n < 10 ? n-1 : 9; cout << number_name[idx] << endl; return 0;
Seems like cookies are disabled on this browser, please enable them to open this website
Conditional Statements
You are viewing a single comment's thread. Return to all comments →