You are viewing a single comment's thread. Return to all comments →
#include <iostream> #include <map> int main() { std::map<int, std::string> number; number[1] = "one"; number[2] = "two"; number[3] = "three"; number[4] = "four"; number[5] = "five"; number[6] = "six"; number[7] = "seven"; number[8] = "eight"; number[9] = "nine"; int start; int end; std::cin >> start; std::cin >> end; for (unsigned i = start; i <= end; i++) { if (i <= 9) { std::cout << number[i] << std::endl; } else { if (i % 2 == 0) { std::cout << "even" << std::endl; } else { std::cout << "odd" << std::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 →