解题思路:
注意事项:
1.英文单词的书写
2.输出格式
参考代码:
#include<iostream> using namespace std; void exchange2(int d) { switch(d) { case 0:cout<<"zero";break; case 1:cout<<"one";break; case 2:cout<<"two";break; case 3:cout<<"three";break; case 4:cout<<"four";break; case 5:cout<<"five";break; case 6:cout<<"six";break; case 7:cout<<"seven";break; case 8:cout<<"eight";break; case 9:cout<<"nine";break; case 10:cout<<"ten";break; case 11:cout<<"eleven";break; case 12:cout<<"twelve";break; case 13:cout<<"thirteen";break; case 14:cout<<"fourteen";break; case 15:cout<<"fifteen";break; case 16:cout<<"sixteen";break; case 17:cout<<"seventeen";break; case 18:cout<<"eighteen";break; case 19:cout<<"nineteen";break; case 20:cout<<"twenty";break; case 30:cout<<"thirty";break; case 40:cout<<"forty";break; case 50:cout<<"fifty";break; } } void exchange1(int n) { if(n<=20) exchange2(n); else { int i=n%10; n-=i; exchange2(n); cout<<' '; exchange2(i); } } int main() { int h,m; while(cin>>h>>m) { char a[10]; if(m!=0) { exchange1(h); cout<<' '; exchange1(m); } else { exchange1(h); cout<<' '<<"o'clock"<<endl; } } return 0; }
0.0分
4 人评分
C语言训练-求矩阵的两对角线上的元素之和 (C语言代码)浏览:3472 |
C语言程序设计教程(第三版)课后习题8.1 (Java代码)浏览:828 |
简单的a+b (C语言代码)浏览:827 |
C语言考试练习题_排列 (C语言代码)浏览:1373 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:672 |
简单的for循环浏览:1495 |
WU-陶陶摘苹果2 (C++代码)浏览:1018 |
【计算球体积】 (C语言代码)浏览:1158 |
求圆的面积 (C语言代码)浏览:1755 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:624 |