[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Skudårs rutine



In <sslug@sslug> "Tom Madsen" <sslug@sslug> writes:

>Er der nogen af jer der er i besidelse af en rutine der kan beregne om et
>givet år er et skud år, som jeg gerne må kikke efter?

Noget i stil med

    int leapyear(int year) 
    {
       /*
        * Leap year if:
        * year is divisible by 4, except if
        *    divisible by 100 except if
        *      divisible by 400
        */

       if (year % 400) return 1;
       if (year % 100) return 0;
       if (year % 4) return 1;
       return 0;
    }

Helt utestet, men det skulle virke.
-- 
Henrik Storner      | "Crackers thrive on code secrecy. Cockcroaches breed 
<sslug@sslug> |  in the dark. It's time to let the sunlight in."
                    |  
                    |          Eric S. Raymond, re. the Frontpage backdoor


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *