logo AlgoBeat OnlineJudge
登录 注册

题解

作者: tyxx040105  ·  发布于 2026-09-24 13:09:09  ·  最后修改于 2026-09-24 19:26:54
已通过
审核员:AlgoBeat 官方账号 · 2026-09-24 19:26:54

本题考查分支结构。

#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,m;
    cin>>h>>m;
    if(h<=7){
        if(h<7) cout<<"EARLY";
        else if(m<30) cout<<"EARLY";
        else cout<<"ON TIME";
    }
    if(h>=8){
        if(h>8) cout<<"LATE";
        else if(m>0) cout<<"LATE";
        else cout<<"ON TIME";
    }
    return 0;
}

暂无评论

登录 后即可评论。