You are viewing a single comment's thread. Return to all comments →
It cant get better
#include <iostream> #include <vector> int main() { std::vector<std::string> words = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; int begin, end; std::cin >> begin >> end; for (int i = begin; i <= end; ++i) { if (i <= 9) std::cout << words[i] << std::endl; else std::cout << (i % 2 == 0 ? "even" : "odd") << std::endl; } return 0; }
For Loop
You are viewing a single comment's thread. Return to all comments →
It cant get better