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