#include <stdio.h>

int main() {
    int h,m;
    scanf("%d %d",&h,&m);
    //45분 미리 뻄
    m=m-45;
    // 0분보다 크면 그냥 내보내
    if(m>=0) {
        printf("%d %d",h, m);
    // 0분보다 작으면 1시간을 60분으로 바꿈(0시가 아닐때)
    } else if (h!=0){
        h-=1;
        m+=60;
        printf("%d %d",h, m);
    //0시일때 23시로 바꿈
    } else {
        h=23;
        m+=60;
        printf("%d %d",h, m);
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: