Solution/C
[BAEKJOON ONLINE JUDGE] 10699번 : 오늘 날짜
뺚
2023. 9. 8. 03:00
시간 제한 : 1 초
메모리 제한 : 256 MB
문제
서울의 오늘 날짜를 출력하는 프로그램을 작성하시오.
입력
입력은 없다.
출력
서울의 오늘 날짜를 "YYYY-MM-DD" 형식으로 출력한다.
#include<stdio.h>
#include<time.h>
int main()
{
time_t now;
struct tm* t;
now = time(NULL);
t = localtime(&now);
printf("%d-%d-%d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday);
return 0;
}