[BOJ/C+]2884目覚まし時計
質問する
https://www.acmicpc.net/problem/2884
に答える
入力を受け取った場合、0->24
出力時24->0
コード#コード#
#include <iostream>
#include <string>
#include <stdio.h>
#include <vector>
using namespace std;
int main(void) {
int h, m;
int time;
cin >> h;
if(h == 0) {
h = 24;
}
cin >> m;
time = 60 * h + m;
time = time - 45;
h = time / 60;
if(h == 24) {
h = 0;
}
m = time % 60;
printf("%d %d", h, m);
return 0;
}
Reference
この問題について([BOJ/C+]2884目覚まし時計), 我々は、より多くの情報をここで見つけました https://velog.io/@rlagksql219/BOJC-2884-알람-시계テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol