terça-feira, agosto 08, 2006

C::TTX

#include <stdio.h>
#include <time.h>

int main(void)
{
     struct tm *today, xmas = { 0, 0, 0, 25, 11, 0 };
     time_t now = time(NULL);
     int ttx;
    
     today = localtime(&now);
     xmas.tm_year = today->tm_year;
     ttx = (mktime(&xmas) - now) / (60 * 60 * 24) + 1;
     printf("%d\n", ttx);
     return(0);
}

domingo, agosto 06, 2006

terça-feira, agosto 01, 2006