You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
656 B
29 lines
656 B
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
int main() {
|
|
char a[22][20]= {"zero","one","two","three","four","five","six", "seven","eight" ,"nine" , "ten", "eleven","twelve" , "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty",""};
|
|
char b[5][20]= {"","twenty","thirty","forty","fifty"};
|
|
int h,m,h1,m1;
|
|
scanf("%d %d",&h,&m);
|
|
if(m==0)
|
|
printf("%s o'clock",a[h]);
|
|
else {
|
|
if(m<20) {
|
|
h1=h/20;
|
|
h=h%20;
|
|
if(h==0)h=21;
|
|
printf("%s %s %s",b[h1],a[h],a[m]);
|
|
} else {
|
|
h1=h/20;
|
|
h=h%20;
|
|
if(h==0)h=21;
|
|
m1=m/10-1;
|
|
m=m%10;
|
|
printf("%s %s %s %s\n",b[h1],a[h],b[m1],a[m]);
|
|
}
|
|
|
|
}
|
|
return 0;
|
|
}
|
|
|