You are viewing a single comment's thread. Return to all comments →
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int a, b; cin >> a >> b; string res; while (a <= b) { if (a > 9) { if (a%2 == 0) cout << "even" << '\n'; else cout << "odd" << '\n'; a++; continue; } res = a == 1? "one" : a == 2? "two" : a == 3? "three" : a == 4? "four" : a == 5? "five" : a == 6? "six" : a == 7? "seven" : a == 8? "eight" : "nine"; cout << res << '\n'; a++; } 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 →
C++ 17