#include<iostream> #include<map> using namespace std; int main(){ map<int,string> time; int h,m,g,t; time[0]="zero"; time[1]="one"; time[2]="two"; time[3]="three"; time[4]="four"; time[5]="five"; time[6]="six"; time[7]="seven"; time[8]="eight"; time[9]="nine"; time[10]="ten"; time[11]="eleven"; time[12]="twelve"; time[13]="thirteen"; time[14]="fourteen"; time[15]="fifteen"; time[16]="sixteen"; time[17]="seventeen"; time[18]="eighteen"; time[19]="nineteen"; time[20]="twenty"; time[30]="thirty"; time[40]="forty"; time[50]="fifty"; cin>>h>>m; if(h>20&&h<60){ g = h%10; h = h-g; cout<<time[h]<<' '<<time[g]<<' '; if(m==0) cout<<"o'clock"; else if(m>20&&m<60) { t = m%10; m = m-t; cout<<time[m]<<' '<<time[t]<<endl; } else cout<<time[m]; } else { cout<<time[h]<<' '; if(m==0) cout<<"o'clock"; else if(m>20&&m<60) { t = m%10; m = m-t; cout<<time[m]<<' '<<time[t]<<endl; } else cout<<time[m]; } }
0.0分
0 人评分
C二级辅导-温度转换 (C语言代码)浏览:2675 |
校门外的树 (C语言代码)浏览:751 |
C语言程序设计教程(第三版)课后习题12.2 (C语言代码)浏览:855 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:627 |
C语言训练-最大数问题 (C语言代码)浏览:648 |
【亲和数】 (C语言代码)浏览:588 |
字符串问题 (C语言代码)浏览:1635 |
用筛法求之N内的素数。 (C语言代码)浏览:711 |
P1000 (C语言代码)浏览:911 |
Hello, world! (C语言代码)浏览:766 |