# 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 */

 

 

지적, 조언, 첨언 모두 환영합니다!!!

+ Recent posts