Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * \file easter.c
- *
- */
- #include <stdio.h>
- /**
- * \brief:
- *
- * \return 0
- */
- int main (FILE in, FILE out)
- {
- int year;
- int golden;
- int century;
- int epact;
- int x, z, d, n;
- scanf("%i",&year);
- golden = year % 19 +1; /* step1 */
- century = year / 100 +1; /* step2 */
- x = (3 * century / 4) -12; /* step3 */
- z = ((8 * century + 5) / 25) - 5;
- d = (5*year / 4 ) - x - 10; /* step4 */
- epact = (11 * golden + 20 + z - x) % 30; /* step5 */
- if( (epact == 25 && golden > 11) || epact == 24){
- epact++;
- }
- n == 44 - epact; /* step6 */
- if(n < 21) n+= 30;
- n = n + 7 - ((d + n) % 7); /* step 7 */
- /* step8 */
- if( n > 31) {
- n = n -31;
- printf("In dem Jahr ist Oster am %i April /n", n);
- }
- else{
- printf("In dem Jahr ist Oster am %i März /n", n);
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement