# Link
https://www.acmicpc.net/problem/10699
10699번: 오늘 날짜
서울의 오늘 날짜를 출력하는 프로그램을 작성하시오.
www.acmicpc.net
# Code - C++
//
// BOJ
// ver.C++
//
// Created by GGlifer
//
// Open Source
#include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
#define endl '\n'
#define len(x) (int)(x).length()
#define size(x) (int)(x).size()
#define str(x) to_string(x)
#define error logic_error("line " + str(__LINE__))
// Set up : Definitions
const int HOUR = 60 * 60;
// Set up : Global Variables
/* None */
// Set up : Functions Declaration
/* None */
int main()
{
// Set up : I/O
ios::sync_with_stdio(false);
cin.tie(nullptr);
// Set up : Input
/* None */
// Process
time_t utc = time(nullptr);
time_t kor = utc + 9 * HOUR;
tm *info = gmtime(&kor);
// Control : Output
cout << put_time(info, "%Y-%m-%d") << endl;
}
// Helper Functions
/* None */
지적, 조언, 첨언 모두 환영합니다!!!
'Problem Solving > 백준' 카테고리의 다른 글
| [ Problem Solving :: 백준 ] 4386 / 별자리 만들기 (0) | 2021.11.15 |
|---|---|
| [ Problem Solving :: 백준 ] 5671 / 호텔 방 번호 (0) | 2021.11.15 |
| [ Problem Solving :: 백준 ] 11657 / 타임머신 (0) | 2021.11.15 |
| [ Problem Solving :: 백준 ] 1337 / 올바른 배열 (0) | 2021.11.15 |
| [ Problem Solving :: 백준 ] 8983 / 사냥꾼 (0) | 2021.11.13 |