Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.88 KB | None | 0 0
  1. /**
  2.  * \file easter.c
  3.  *
  4.  */
  5.  
  6. #include <stdio.h>
  7. /**
  8.  * \brief:
  9.  *
  10.  * \return 0
  11.  */
  12. int main (FILE in, FILE out)
  13. {
  14.    
  15.   int year;
  16.   int golden;
  17.   int century;
  18.   int epact;
  19.   int x, z, d, n;
  20.  
  21.  
  22.   scanf("%i",&year);
  23.    
  24.   golden = year % 19 +1;    /* step1 */
  25.    
  26.   century = year / 100 +1;    /* step2 */
  27.    
  28.   x = (3 * century / 4) -12;    /* step3 */
  29.   z = ((8 * century + 5) / 25) - 5;
  30.  
  31.   d = (5*year / 4 ) - x - 10;  /* step4 */
  32.  
  33.   epact = (11 * golden + 20 + z - x) % 30;  /* step5 */
  34.   if( (epact == 25 && golden > 11) || epact == 24){
  35.     epact++;
  36.   }
  37.  
  38.   n == 44 - epact;  /* step6 */
  39.   if(n < 21) n+= 30;
  40.  
  41.   n = n + 7 - ((d + n) % 7);    /* step 7 */
  42.  
  43.   /* step8 */
  44.   if( n > 31) {
  45.     n = n -31;
  46.     printf("In dem Jahr ist Oster am %i April /n", n);
  47.   }
  48.     else{
  49.       printf("In dem Jahr ist Oster am %i März /n", n);
  50.     }; 
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement