// 2004年1月10日13時37分4秒問題の実験
#include<stdio.h>
#include<time.h>
int main(int argc, char *argv[])
{
    time_t now;                 // 現在の日時
    time_t ft10min;             // nowの10分後の日時
    time_t half;                // 上記2つの中間の日時 (足して2で割る)
    time_t truehalf;            // 上記2つの中間の日時 (2で割って足す)

    now = time(NULL);
    ft10min = now + 10 * 60;
    half = (now + ft10min) / 2;
    truehalf = (time_t) ((double) now / 2.0 + (double) ft10min / 2.0);

    printf("・現在の日時         = %s", ctime(&now));
    printf("・10分後の日時       = %s", ctime(&ft10min));
    printf("・上記を足した半分   = %s", ctime(&half));
    printf("・正しく計算した半分 = %s", ctime(&truehalf));

    return 0;
}