cgy12306
[백준 BoJ] 1476 - 날짜 계산 본문
#include<iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int E, S, M, year = 1;
cin >> E >> S >> M;
while (!(E == 1 && S == 1 && M == 1)) {
E--; S--; M--;
if (E == 0) E = 15;
if (S == 0) S = 28;
if (M == 0) M = 19;
year++;
}
cout << year;
return 0;
}
'Algorithm > C++' 카테고리의 다른 글
[백준 BoJ] 1260 - DFS와 BFS (0) | 2021.03.25 |
---|---|
[백준 BoJ] 9095 - 1, 2, 3 더하기 (0) | 2021.03.25 |
[백준 BoJ] 1551 - 수열의 변화 (0) | 2021.03.25 |
[백준 BoJ] 1547 - 공 (0) | 2021.03.25 |
[백준 BoJ] 10816 - 숫자 카드 2 (0) | 2021.03.25 |
Comments