カレンダーを出力するプログラム [詳細]
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "number_set.h"
関数 | |
int | day_of_week (int year, int month, int day) |
int | month_days (int year, int month) |
int | judge_month (int year, int month, char holiday_name[HOLY_MAX][HOLY_NAME], int holiday_days[HOLY_MAX]) |
void | month_print_calendar_s64_1 (int year, int month) |
void | month_print_calendar_h1_1 (int year, int month) |
void | print_calendar_three_gengoh (int year[COL_CAL], int month[COL_CAL]) |
void | print_calendar_three_1989 (int year[COL_CAL], int month[COL_CAL]) |
カレンダーを出力するプログラム
int day_of_week | ( | int | year, | |
int | month, | |||
int | day | |||
) |
機能
year年month月day日の曜日をツェラーの公式で算出して求める
year | 年 | |
month | 月 | |
day | 日 |
曜日 |
被参照自作関数
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルoutput_calendar.c内 関数month_print_calendar_today
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_s64_1
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_h1_1
ファイルcalendar_main.c内 関数make_calendar
ファイルcalendar_main.c内 関数make_three_calendar_1989
ファイルinsert_holidays.c内 関数Jan_holiday
ファイルinsert_holidays.c内 関数Jan_holiday
ファイルinsert_holidays.c内 関数Feb_holiday
ファイルinsert_holidays.c内 関数Mar_holiday
ファイルinsert_holidays.c内 関数Api_holiday
ファイルinsert_holidays.c内 関数May_holiday
ファイルinsert_holidays.c内 関数Jul_holiday
ファイルinsert_holidays.c内 関数Sep_holiday
ファイルinsert_holidays.c内 関数Oct_holiday
ファイルinsert_holidays.c内 関数Nov_holiday
ファイルinsert_holidays.c内 関数Dec_holiday
参照自作関数
なし
int judge_month | ( | int | year, | |
int | month, | |||
char | holiday_name[HOLY_MAX][HOLY_NAME], | |||
int | holiday_num[HOLY_MAX] | |||
) |
機能
入力された月による祝日有無を判定する
year | 年 | |
month | 月 | |
holiday_name[][] | 祝日名代入する配列 | |
holiday_num[][] | 祝日日付代入配列(Ver1.1) |
m_holidays | 月ごとの祝日日数を返す |
被参照自作関数
ファイルcalendar_main.c内 関数make_calendar
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルoutput_calendar.c内 関数month_print_calendar_today
参照自作関数
ファイルinsert_holidays.c内 関数Jan_holiday
ファイルinsert_holidays.c内 関数Feb_holiday
ファイルinsert_holidays.c内 関数Mar_holiday
ファイルinsert_holidays.c内 関数Api_holiday
ファイルinsert_holidays.c内 関数May_holiday
ファイルinsert_holidays.c内 関数Jul_holiday
ファイルinsert_holidays.c内 関数Sep_holiday
ファイルinsert_holidays.c内 関数Oct_holiday
ファイルinsert_holidays.c内 関数Nov_holiday
ファイルinsert_holidays.c内 関数Dec_holiday
int month_days | ( | int | year, | |
int | month | |||
) |
機能
year年month月の月日数を取得する
year | 年 | |
month | 月 |
月日数 |
被参照自作関数
ファイルoutput_calendar.c内 関数month_print_calendar
ファイルoutput_calendar.c内 関数month_print_calendar_today
ファイルoutput_calendar_gengoh.c内 関数month_print_calendar_h1_1
ファイルcalendar_main.c内 関数make_three_calendar
ファイルcalendar_main.c内 関数make_three_calendar_1989
参照自作関数
ファイルcalendar_main.c内 関数is_leap
備考
2月のみ閏年は29日、平年は28日
void month_print_calendar_h1_1 | ( | int | year, | |
int | month | |||
) |
機能
year年month月のカレンダーを祝日とともに表示する
処理詳細
(1) year年month月の初日の曜日を算出
(2) year年month月の月日数を取得
(3) 初日から月末までのカレンダーを表示
(3.1) 日曜日なら赤で表示
(3.2) 土曜日なら青で表示
(3.3) それ以外の曜日は黒で表示
(4) 祝日名を表示する
year | 年 | |
month | 月 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_year_month_gengoh
参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルinsert_hoildays.c内 関数judge_months
void month_print_calendar_s64_1 | ( | int | year, | |
int | month | |||
) |
機能
year年month月のカレンダーを祝日とともに表示する
処理詳細
(1) year年month月の初日の曜日を算出
(2) year年month月の月日数を取得
(3) 初日から月末までのカレンダーを表示
(3.1) 日曜日なら赤で表示
(3.2) 土曜日なら青で表示
(3.3) それ以外の曜日は黒で表示
(4) 祝日名を表示する
year | 年 | |
month | 月 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数opreate_year_month_gengoh
参照自作関数
ファイルcalendar_main.c内 関数day_of_week
ファイルcalendar_main.c内 関数month_days
ファイルinsert_holidays.c内 関数judge_month
void print_calendar_three_1989 | ( | int | year[COL_CAL], | |
int | month[COL_CAL] | |||
) |
機能 指定された3ヶ月分の年と月を表示する(平成元年版)
処理詳細
(1) 指定された3ヶ月分の年と月をバッファに入れる
(2) バッファを横に表示する
year[] | 年 | |
month[] | 月 |
被参照自作関数
ファイルopreate_calendar.c内 関数input_1989_three
ファイルopreate_calendar_gengoh.c内 関数input_1989_1to3
参照自作関数
なし
void print_calendar_three_gengoh | ( | int | year[COL_CAL], | |
int | month[COL_CAL] | |||
) |
機能 指定された3ヶ月分の年と月を表示する(元号版)
処理詳細
(1) 指定された3ヶ月分の年と月をバッファに入れる
(2) バッファを横に表示する
year[] | 年 | |
month[] | 月 |
被参照自作関数
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_gengoh
ファイルopreate_calendar_gengoh.c内 関数input_ym_three_today_gengoh
参照自作関数
なし