团体程序设计天梯赛 大笨钟

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/clx55555/article/details/62040318
#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;

int main()
{
    int a,b;
    while(~scanf("%d:%d",&a,&b))
    {
        if(a>=0&&a<=11)
        {
            printf("Only %02d:%02d.  Too early to Dang.\n",a,b);
            continue;
        }
        else if(a==12)
        {
            if(b==0)
            {
                printf("Only %02d:%02d.  Too early to Dang.\n",a,b);
                continue;
            }
            else
            {
                printf("Dang\n");
                continue;
            }
        }
        if(a>=13&&a<=23)
        {
            if(b!=0)a++;
            a-=12;
            for(int i=1; i<=a; i++)
                printf("Dang");
            printf("\n");
        }
    }
    return 0;
}

没有更多推荐了,返回首页