You are viewing a single comment's thread. Return to all comments →
The ternary operator is the best!
int main() { string hour[]={"even","odd","one","two","three","four","five","six","seven","eight","nine"}; int a,b; for(cin>>a>>b;a<=b;a++) cout<<hour[a>9?a%2:a+1]<<'\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 →
The ternary operator is the best!