0
点赞
收藏
分享

微信扫一扫

大笨钟(10分)

闲云困兽 2022-04-13 阅读 41
c++

在这里插入图片描述

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main(){
  char howtime[10];
  cin>>howtime;
  //对小时、分钟做处理
  int hour,min;
  hour = (howtime[0]-'0')*10+(howtime[1]-'0');
  min = (howtime[3]-'0')*10+(howtime[4]-'0');
  if(hour<=12&&hour>=0){
    cout<<"Only "<<howtime<<".  Too early to Dang."<<endl;
  }else{
    if(min == 0){
        for(int i=0;i<hour-12;i++){
            cout<<"Dang";
        }
    }else {
        for(int i=0;i<hour+1-12;i++){
            cout<<"Dang";
        }
    }
  }
}


举报

相关推荐

0 条评论