15 条题解

  • 0
    @ 2026-5-31 18:06:09
    #include <bits/stdc++.h>
    using namespace std;
    int main(){
    	char num[21][11]={"zero","one","two","three","four","five","six","seven", 
    	"eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen",
    	"sixteen","seventeen","eighteen","nineteen","twenty"};
    	char min[6][11]={"ten","twenty","thirty","forty","fifty","sixty"};
        int h,m;
        scanf("%d %d",&h,&m);
        if(h>20){
        	printf("%s %s",num[20],num[h-20]);
    	}else{
    		printf("%s",num[h]);
    	}
        if(m==0){
        	printf(" o'clock");
    	}else{
            if (m>=20){
                printf(" %s",min[m/10-1]);
                if(m%10!=0){
                	printf(" %s",num[m%10]);
    			}
            }else{
            	printf(" %s",num[m]);
    		}
        }
    	return 0;
    }
    

    信息

    ID
    1084
    时间
    1000ms
    内存
    128MiB
    难度
    6
    标签
    递交数
    244
    已通过
    83
    上传者