You are viewing a single comment's thread. Return to all comments →
using namespace std;
int main() { int a,b; cin>>a; cin>>b; string s[20]={"one","two","three","four","five","six","seven","eight","nine"};
for(int i=a;i<=b;i++) { if(i>=1 && i<=9) { cout<<s[i-1]<<endl; } else if(i>9 && i%2==0) { cout<<"even"<<endl; }else{ cout<<"odd"<<endl; } } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
For Loop
You are viewing a single comment's thread. Return to all comments →
include
include
using namespace std;
int main() { int a,b; cin>>a; cin>>b; string s[20]={"one","two","three","four","five","six","seven","eight","nine"};
}