-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNoNumerals.c
50 lines (49 loc) · 1009 Bytes
/
NoNumerals.c
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
#include <stdio.h>
#include <string.h>
int main() {
char s[60];
gets(s);
int n;
n = strlen(s);
for(int i = 0; i < n; i++){
if(s[i] == '0'){
printf("zero");
}
else if(s[i] == '1'){
if(s[i+1] == '0'){
printf("ten");
i++;
}
else{
printf("one");
}
}
else if(s[i] == '2'){
printf("two");
}
else if(s[i] == '3'){
printf("three");
}
else if(s[i] == '4'){
printf("four");
}
else if(s[i] == '5'){
printf("five");
}
else if(s[i] == '6'){
printf("six");
}
else if(s[i] == '7'){
printf("seven");
}
else if(s[i] == '8'){
printf("eight");
}
else if(s[i] == '9'){
printf("nine");
}
else{
printf("%c", s[i]);
}
}
}