You are viewing a single comment's thread. Return to all comments →
A simplified way
#include <iostream> #include <cstdio> using namespace std; int main() { int a, b; cin >> a; cin >> b; string num[9] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; for(int n=a; n<=b;n++) { if(n<=9) cout << num[n-1] << endl; else if(n%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 →
A simplified way