解题思路:
注意事项:
参考代码:
#include <iostream>
#include <deque>
#include <string>
#include <iterator>
#include <numeric>
#include <cmath>
#include <cstdlib>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <string.h>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
string s1[21]={"zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"};
if(x>=0&&x<=20){
cout<<s1[x]<<" ";
}
if(x>=21&&x<24){
cout<<"twenty"<<" "<<s1[x-20]<<" ";
}
if(y==0){
cout<<"o'clock";
}
if(y>0&&y<=20){
cout<<s1[y];
}
if(y>=21&&y<=29){
cout<<"twenty"<<" "<<s1[y-20];
}
if(y==30){
cout<<"thirty";
}
if(y>=31&&y<=39){
cout<<"thirty "<<s1[y-30];
}
if(y==40){
cout<<"forty";
}
if(y>=41&&y<=49){
cout<<"forty "<<s1[y-40];
}
if(y==50){
cout<<"fifty ";
}
if(y>=51&&y<60){
cout<<"fifty "<<s1[y-50];
}
return 0;
}
0.0分
0 人评分
Pascal三角 (C语言代码)格式错误浏览:551 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:693 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:588 |
本人酷爱递归实现很多问题,这里也是浏览:632 |
Tom数 (C语言代码)浏览:598 |
Quadratic Equation (C语言代码)浏览:1034 |
众数问题 (C语言代码)浏览:717 |
整数分类问题 为什么输出总是数字8啊浏览:451 |
字符串对比 (C++代码)浏览:597 |
简单的a+b (C语言代码)浏览:363 |