参考代码:
#include <stdio.h> void read(int x){ int m=0; if(x>20){ m = x%10; x = x-m; } switch(x){ case 0: printf("zero"); break; case 1: printf("one"); break; case 2: printf("two"); break; case 3: printf("three"); break; case 4: printf("four"); break; case 5: printf("five"); break; case 6: printf("six"); break; case 7: printf("seven"); break; case 8: printf("eight"); break; case 9: printf("nine"); break; case 10: printf("ten"); break; case 11: printf("eleven"); break; case 12: printf("twelve"); break; case 13: printf("thirteen"); break; case 14: printf("fourteen"); break; case 15: printf("fifteen"); break; case 16: printf("sixteen"); break; case 17: printf("seventeen"); break; case 18: printf("eighteen"); break; case 19: printf("nineteen"); break; case 20: printf("twenty"); break; case 30: printf("thirty"); break; case 40: printf("forty"); break; break; case 50: printf("fifty"); break; } if(m!=0){ printf(" "); read(m); } } int main(){ int h,m; scanf("%d %d",&h,&m); if(m==0){ read(h); printf(" o'clock"); } else{ read(h); printf(" "); read(m); } return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:547 |
人见人爱A+B (C++代码)浏览:1070 |
A+B for Input-Output Practice (III) (C++代码)浏览:898 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:645 |
C语言训练-素数问题 (C语言代码)浏览:1699 |
程序员的表白 (C语言代码)浏览:707 |
用筛法求之N内的素数。 (C语言代码)浏览:891 |
C语言程序设计教程(第三版)课后习题6.8 (C语言代码)浏览:545 |
蛇行矩阵 (C语言代码)浏览:607 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:593 |