typedef struct { unsigned char d; unsigned char m; } Date; void easter_c(unsigned short Y, Date *d) { int G = (Y % 19) + 1; int C = (int)(Y / 100) + 1; int X = 3 * C / 4 - 12; int Z = (8 * C + 5) / 25 - 5; int D = 5 * Y / 4 - X - 10; int E = (11 * G + 20 + Z - X) % 30; if (((E == 25) && (G > 11)) || (E == 24)) ++E; int N = 44 - E; if (N < 21) N += 30; N = N + 7 - ((D + N) % 7); if (N > 31) { d->d = N - 31; d->m = 4; } else { d->d = N; d->m = 3; } }
You need to create an account or log in to post comments to this site.