You are viewing a single comment's thread. Return to all comments →
#include <iostream> #include <cstdio> using namespace std; int main() { ios::sync_with_stdio(false); int a, b; string str_check; string str_num[] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; cin >> a >> b; for (int i = a; i <= b; i++) { if (i > 9) { str_check = (i % 2 == 0) ? "even" : "odd"; cout << str_check << endl; } else { cout << str_num[i - 1] << 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 →