# Include
# Include
# Include
# Include
Int a [31] = {, 31 }; int main () {int Leap (int); int Month (int); void print (int k, int t, int day); int I, j = 0, k, m, n, t =-6; int day; int total = 1; printf ("Enter the year:"); scanf ("% d", & m ); printf ("Enter the month:"); scanf ("% d", & n); getchar (); do {system ("cls "); printf ("% d month: \ n", m, n); total = 365 * (m-1); for (I = 1; I
1) total --; if (total = 0) k = (total + 1) % 7; elsek = (total + 2) % 7; print (k, t, day); printf ("select:"); switch (getch () {case '>': if (n = 12) {m ++; n = 1;} elsen ++; break; case '<': if (n = 1) {m --; n = 12;} else n --; break; case '? ': Printf ("Enter year:"); scanf ("% d", & m); printf ("Enter month:"); scanf ("% d ", & n); break; case '#': j = 1; break;} if (j = 1) break; putchar (10) ;}while (1 ); return 0;} int Month (int n) {int day; switch (n) {case 1: case 3: case 5: case 7: case 8: case 10: case 12: day = 31; break; case 2: day = 28; break; case 4: case 6: case 9: case 11: day = 30; break; default: printf ("the month you entered is incorrect. Please enter it again! \ N ") ;}return day ;}int Leap (int m) {// return 1 for a Leap year; otherwise, return 0. Int I = 0; if (m % 4 = 0 & m % 100! = 0 | m % 400 = 0) I = 1; return I;} void print (int k, int t, int day) {FILE * fp; if (fp = fopen ("abc.txt", "w") = 0) {printf ("failed to open \ n"); exit (1);} int I; printf ("\ n October 5, 6, 6 \ n"); fprintf (fp, "\ n October 5, 6, 6 \ n"); printf ("audio \ n "); fprintf (fp, "------------------------------------------------------- \ n"); for (I = 1; I <= k; I ++) {printf (""); fprintf (fp, "") ;}for (I = 0; I
Next month \ n "); printf (" <previous month \ n "); printf ("? Custom year/year \ n "); printf (" # exit \ n "); printf (" ------------------------ \ n "); fclose (fp );}