In my IDE my code working well but it’s keep showing wrong answer.
Here is my code:
#include <iostream>
int main()
{
using namespace std;
int a,b;
cin >> a;
cin >> b;
string aa[9] = {"one","two","three","four","five","six","seven","eight","nine"};
for(int i = a;i <= 9;i++){
cout << aa[i-1] << endl;
}
for(int i = a;i <= 9;i++){
if(i%2 == 0){
cout << "even" << endl;
}
else{
cout << "odd" << endl;
}
}
return 0;
}
Original question link in hackerrank.
Can you please tell me what’s going on with my code?