1234567891011121314151617181920212223242526272829303132
#include <iostream> #include <vector> using namespace std; int main(){ vector<string> nums(10); nums[0] = "zero"; nums[1] = "one"; nums[2] = "two"; nums[3] = "three"; nums[4] = "four"; nums[5] = "five"; nums[6] = "six"; nums[7] = "seven"; nums[8] = "eight"; nums[9] = "nine"; nums[10] = "ten"; cout << "Enter a number to be converted to a word"; int num; cin >> num; cout << num << " = " << nums[num]; return 0; }