You are viewing a single comment's thread. Return to all comments →
using namespace std; int main() { unsigned int a; unsigned int b; string s_arr[] = {"one","two","three","four","five","six","seven","eight","nine"}; cin >> a; cin >> b; for(; a <= b; ++a){ if(a <= sizeof(s_arr)/sizeof(s_arr[0])) cout << s_arr[a-1] << endl; if(a > sizeof(s_arr)/sizeof(s_arr[0])){ if((a%2) == 0) cout << "even\n"; else cout << "odd\n"; } } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
For Loop
You are viewing a single comment's thread. Return to all comments →