# 13636 - Two Zero Two Four >author: Utin ###### tags: `input` --- ## Brief See the code below ## Solution 0 ```c= #include<stdio.h> int main() { char c, pre_c = '\0'; int sum = 1; char change[10][6] = {"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"}; while((c = getchar()) != EOF) { if(c == ' ') { continue; } else if(pre_c == '\0') { pre_c = c; continue; } else if(c == pre_c) { sum += 1; } else { if(sum > 1) { printf("%s", change[sum]); printf("%s", change[pre_c-48]); } else { printf("%s", change[pre_c-48]); } if(c == '\n') { putchar(c); break; } sum = 1; } pre_c = c; } } // By Utin ``` ## Reference
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up