Question 204.2022 Winter Ladder Training - 7-4 Big Ben (10 points)


Question 204.2022 Winter Ladder Training - 7-4 Big Ben (10 points)


1. The topic

insert image description here

2. Problem solving

#include <bits/stdc++.h>

using namespace std;

int main()
{
    
    
    int hh,mm;
    scanf("%d:%d",&hh,&mm);
    if(hh<12||(hh==12&&mm==0))//小于12时或者恰好等于12时都是不dang
    {
    
    
        printf("Only %02d:%02d.  Too early to Dang.",hh,mm);
    }
    else
    {
    
    
        int n=hh-12;
        if(mm>0)
        {
    
    
            n++;
        }
        for(int i=0;i<n;i++)
        {
    
    
            printf("Dang");
        }
    }
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324345494&siteId=291194637