danguyenwork
10/12/2017 - 7:35 PM

Array map C++

# intmap

#include <iostream>
#include <cstdio>
using namespace std;

int main() {
    // Complete the code.
    int start, stop;
    cin >> start >> stop;
    string intmap[9] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
    
    for (int i=start; i<=stop; i++){
        if ((1 <= i) && (i <= 9)){
            cout << intmap[i-1] << "\n";
        }
        else if (i % 2 == 0){
            cout << "even" << "\n";
        }
        else {
            cout << "odd" << "\n";
        }
    }
        
}