-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3forloop.cpp
52 lines (43 loc) · 970 Bytes
/
3forloop.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* Input Format
You will be given two positive integers, and (), separated by a newline.
Output Format
For each integer in the inclusive interval :
If , then print the English representation of it in lowercase. That is "one" for , "two" for , and so on.
Else if and it is an even number, then print "even".
Else if and it is an odd number, then print "odd".
Note:
Sample Input
8
11
Sample Output
eight
nine
even
odd */
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
// Complete the code.
int a,b;
cin>>a;
cin>>b;
int i;
string k[10]={"zero","one","two","three","four","five","six","seven","eight","nine"};
for(i=a;i<=b;i++){
if(i<=9){
cout<<k[i]<<endl;
}
else{
if(i%2==0){
cout<<"even";
cout<<endl;
}
else{
cout<<"odd";
cout<<endl;
}
}
}
return 0;
}