❶ c語言程序設計萬年歷怎麼編寫
#include <stdio.h>
int IsLeapYear(int);
main()
{
int i;
int day;
int year;
int temp;
int temp_i;
long int Year_days = 0;
int Year_Start = 1;
int Per_Year_Days;
int month_day[]={31,28,31,30,31,30,31,31,30,31,30,31,29};
printf("Please enter the year: ");
scanf("%d",&year);
while(Year_Start < year)
{
if( IsLeapYear( Year_Start ) )
Per_Year_Days = 366;
else
Per_Year_Days = 365;
Year_days = Year_days + Per_Year_Days;
Year_Start++;
}
for( temp = 1; temp <=12; temp++ )
{
switch( temp )
{
case 1:
printf(" January(%d)\n",year);
break;
case 2:
printf(" February(%d)\n",year);
break;
case 3:
printf(" March(%d)\n",year);
break;
case 4:
printf(" April(%d)\n",year);
break;
case 5:
printf(" May(%d)\n",year);
break;
case 6:
printf(" June(%d)\n",year);
break;
case 7:
printf(" July(%d)\n",year);
break;
case 8:
printf(" August(%d)\n",year);
break;
case 9:
printf(" September(%d)\n",year);
break;
case 10:
printf(" October(%d)\n",year);
break;
case 11:
printf(" November(%d)\n",year);
break;
case 12:
printf(" December(%d)\n",year);
break;
}
i = Year_days % 7;
printf("Mon Tue Wed Thu Fri Sat Sun\n");
if( i != 0 )
for( temp_i = 0; temp_i < i; temp_i++)
printf(" ");
day = 1;
if( IsLeapYear(year) && temp == 2)
while( day <= month_day[12] )
{
if( day >1 )
if( Year_days % 7 == 0 )
printf("\n");
if( day >= 10 )
printf("%d ",day);
else
printf("%d ",day);
Year_days++;
day++;
}
else
while (day <= month_day[temp-1])
{
if( day > 1 )
if( Year_days % 7 == 0 )
printf("\n");
if( day >=10 )
printf("%d ",day);
else
printf("%d ",day);
Year_days++;
day++;
}
printf("\n");
if( getch() == 'q' )
exit(0);
}
getch();
}
int IsLeapYear( int year )
{
if ((year %4 == 0) && (year % 100 != 0) ||
(year % 400 == 0) )
return 1;
else
return 0;
}
❷ C語言課程設計 萬年歷
額。寫過,我去找找
#include<stdio.h>
void PrintMonthCalender(int startDay,int days);/*函數原型*/
int GetWeekDay(int year,int month);/*函數原型*/
int GetMonthDays(int year,int month);/*函數原型*/
main()
{
int month,year;/*定義變數*/
printf("input the year and month<YYYY-MM>:");
scanf("%d-%d",&year,&month);/*讀入變數*/
printf("\t\t\t%d-%d\n",year,month);
printf("Sun.\tMon.\tTue.\tWed.\tThu.\tFri.\tSat.\n");/*列印日歷表頭*/
PrintMonthCalender(GetWeekDay(year,month),GetMonthDays(year,month));/*調用函數子程序,列印出某年某月日歷*/
return 0;
}
/*定義列印日歷子程序*/
void PrintMonthCalender(int startDay,int days)
{
int k=0,n=1;
while(k<startDay)
{
printf(" \t");
k++;
}
if(k==startDay&&k!=6)
{
printf("%d\t",n);
k++;
n++;
}
else if(k==startDay&&k==6)
{
printf("%d\n",n);
k++;
n++;
}
while(n<days)
{
if(k%7==6)
{
printf("%d\n",n);
k++;
n++;
}
else
{
printf("%d\t",n);
k++;
n++;
}
}
if(n=days)
{
printf("%d\n",n);
n++;
}
}
/*定義求某月一號為周幾子程序*/
int GetWeekDay(int year,int month)
{
int GetMonthDays(int year,int month);
int n,WeekDay,days;
days=(year-1)*365+(year-1)/400+(year-1)/4-(year-1)/100;
for(n=1;n<month;++n)
days=days+GetMonthDays(year,n);
WeekDay=(days+1)%7;
return WeekDay;
}
/*定義求某年某月的天數子程序*/
int GetMonthDays(int year,int month)
{
int MonthDays;
if((year%4==0&&year%100!=0)||year%400==0)
{
if(month==4||month==6||month==9||month==11)
MonthDays=30;
else if(month==2)
MonthDays=29;
else
MonthDays=31;
}
else
{
if(month==4||month==6||month==9||month==11)
MonthDays=30;
else if(month==2)
MonthDays=28;
else
MonthDays=31;
}
return MonthDays;
}
❸ 跪求~c語言課程設計 萬年歷
希望對您有所幫助,這是我在當時做的一個小課題。
#include "stdio.h" /* Required for MS-DOS use */
#define ENTER 0x1C0D /* Enter key */
int year, month, day;
static char *days[8] = {" ","Sunday ","Monday ","Tuesday ",
"Wednesday","Thursday ","Friday ","Saturday "};
struct TIMEDATE {
int year; /* year 1980..2099 */
int month; /* month 1=Jan 2=Feb, etc. */
int day; /* day of month 0..31 */
int hours; /* hour 0..23 */
int minutes; /* minute 0..59 */
int seconds; /* second 0..59 */
int hsecs; /* 1/100ths of second 0..99 */
char dateline[47]; /* date & time together */
};
static struct TIMEDATE today;
main()
{
char cmonth[3];
char cday[3];
char cyear[5];
double getdays();
double daynumb, numbnow;
int weekday, retcode, dayer, i;
dayer = datetime(&today);
clrscn();
for (i=0;i<3;++i)cmonth[i]='\0';
for (i=0;i<3;++i)cday[i]='\0';
for (i=0;i<5;++i)cyear[i]='\0';
putstr(5,8,14,"Enter date in MM DD YYYY format:");
while (retcode != ENTER)
{
retcode = bufinp(5,41,13,2,cmonth);
if (retcode != ENTER) retcode = bufinp(5,44,13,2,cday);
if (retcode != ENTER) retcode = bufinp(5,47,13,4,cyear);
}
year = atoi(&cyear);
month = atoi(&cmonth);
day = atoi(&cday);
daynumb = getdays(year, month, day);
numbnow = getdays(today.year, today.month, today.day);
weekday = weekdays(daynumb);
if (numbnow - daynumb == 0)
printf("\n\n%02d-%02d-%d is",month, day, year);
if (numbnow - daynumb > 0)
printf("\n\n%02d-%02d-%d was",month, day, year);
if (numbnow - daynumb < 0)
printf("\n\n%02d-%02d-%d will be",month, day, year);
printf(" a %s\n",days[weekday]);
} /* end MAIN */
/************************************************************
* GETDAYS - From integer values of year (YYYY), month *
* (MM) and day (DD) this subroutine returns a *
* double float number which represents the *
* number of days since Jan 1, 1980 (day 1). *
* This routine is the opposite of GETDATE. *
************************************************************/
double getdays(year, month, day)
int year, month, day;
{
int y,m;
double a,b,d, daynumb;
double floor(),intg();
/**********************************
** make correction for no year 0 **
**********************************/
if (year < 0) y = year + 1;
else y = year;
/*********************************************************
** Jan and Feb are months 13 and 14 in this calculation **
*********************************************************/
m = month;
if (month < 3)
{
m = m + 12;
y = y - 1;
}
/**************************
** calculate Julian days **
**************************/
d = floor(365.25 * y) + intg(30.6001 * (m + 1)) + day - 723244.0;
/**********************************************
** use Julian calendar if before Oct 5, 1582 **
**********************************************/
if (d < -145068.0) daynumb = d;
/*************************************
** otherwise use Gregorian calendar **
*************************************/
else
{
a = floor(y / 100.0);
b = 2 - a + floor(a / 4.0);
daynumb = d + b;
}
return(daynumb);
} /* end GETDAYS */
/********************************************************
* GETDATE - This routine takes a double float number *
* representing the number of days since Jan 1,*
* 1980 (day 1) and returns the year month and *
* day as pointer integers *
* This routine is the opposite of GETDAYS *
********************************************************/
getdate(numb)
double numb;
{
double a,aa,b,c,d,e,z;
double date;
date = numb;
z = intg(date + 2444239.0);
if (date < -145078.0) a = z;
else
{
aa = floor((z - 1867216.25) / 36524.25);
a = z + 1 + aa - floor(aa/4.0);
}
b = a + 1524.0;
c = intg((b - 122.1) / 365.25);
d = intg(365.25 * c);
e = intg((b - d) / 30.6001);
day = b - d - intg(30.6001 * e);
if (e > 13.5) month = e - 13.0;
else month = e - 1.0;
if (month > 2) year = c - 4716.0;
else year = c - 4715.0;
if (year < 1) --year;
return;
} /* end GETDATE */
/********************************************************
* WEEKDAYS - This routine takes a double float number *
* representing the number of days since Jan 1,*
* 1980 (day 1) and returns the day of the week*
* where 1 = Sunday, 2 = Tuesday, etc. *
********************************************************/
int weekdays(numb)
double numb;
{
double dd;
int day;
dd = numb;
while (dd > 28000.0) dd = dd - 28000.0;
while (dd < 0) dd = dd + 28000.0;
day = dd;
day = ((day + 1) % 7) + 1;
return(day);
}
/********************************************************
* FRACT - This routine takes a double float number *
* and returns the fractional part as a double *
* float number *
********************************************************/
double fract(numb)
double numb;
{
int inumb;
double fnumb;
while (numb < -32767) numb += 32767;
while (numb > 32767) numb -= 32767;
inumb = numb;
fnumb = inumb;
return(numb-fnumb);
} /* end FRACT */
/********************************************************
* FLOOR - This routine takes a double float number *
* and returns the next smallest integer *
********************************************************/
double floor(numb)
double numb;
{
double fract(), intg();
double out;
out = intg(numb);
if (numb < 0 && fract(numb) != 0) out -= 1.0;
return(out);
} /* end FLOOR */
/********************************************************
* INTG - This routine takes a double float number *
* and returns the integer part as a double *
* float number *
********************************************************/
double intg(numb)
double numb;
{
double fract();
return(numb - fract(numb));
} /* end INTG */
❹ 急求c語言製作的萬年歷
#include "stdio.h" void main() { int year,month,day,sum=0,h=0,i,week; char answer; printf("*********************歡迎使用萬年歷**********************\n"); do { fflush(stdin); printf("請輸入年份:"); scanf("%d",&year); printf("請輸入月份:"); scanf("%d",&month); switch(month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: day=31; break; case 4: case 6: case 9: case 11: day=30; break; case 2: day=28; if(year%4==0 && year%100!=0 || year%400==0) { day+=1; break; } } for(i=1900;i<year-1;i++) { if(year%4==0 && year%100!=0 || year%400==0) { sum+=366; } else { sum+=365; } } for(i=1;i<=month-1;i++) { switch(i) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: sum+=31; break; case 4: case 6: case 9: case 11: sum+=30; break; case 2: sum+=28; if(year%4==0 && year%100!=0 || year%400==0) { sum+=1; break; } } } week=sum%7+1; printf("星期天\t星期一\t星期二\t星期三\t星期四\t星期五\t星期六\n"); if(week!=7) { for(i=1;i<=week;i++) { printf(" \t"); h++; } } for(i=1;i<=day;i++) { printf("%d\t",i); h++; if(h==7) { printf("\n"); h=0; } } fflush(stdin); printf("\n是否繼續:(y/n):"); scanf("%c",&answer); } while(answer=='y'); } 呵呵 不好意思 可能沒你要求那麼完善 但是你說的基本已經給你搞定 其他的樓主修改一下即可!!
❺ 用C語言製作萬年歷
TC 2.0
/* welcome to use the WanNianLi system!
Copyright @ 2005 KongXinCai All rights reserved!:):):)*/
#include<stdio.h>
#include<stdlib.h>
char* month_str[]={"January","February","March","April","May","June","July","August","September","October","November","December"};
char* week[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
int IsLeapYear(int year) /*find out the year is leap year or not*/
{
if((year%4==0&&year%100!=0)||(year%400==0))
return 1;
else
return 0;
}
int month_day(int year,int month)
{
int mon_day[]={31,28,31,30,31,30,31,31,30,31,30,31};
if(IsLeapYear(year)&&month==2)
return 29;
else
return(mon_day[month-1]);
}
int DaySearch(int year,int month,int day) /*search what day this day is*/
{
int c=0;
float s;
int m;
for(m=1;m<month;m++)
c=c+month_day(year,m);
c=c+day;
s=year-1+(float)(year-1)/4+(float)(year-1)/100+(float)(year-1)/400-40+c;
return ((int)s%7);
}
int PrintAllYear(int year)/*print the all year*/
{
int temp;
int i,j;
printf("\n\n%d Calander\n",year);
for(i=1;i<=12;i++)
{
printf("\n\n%s(%d)\n",month_str[i-1],i);
printf("0 1 2 3 4 5 6 \n");
printf("S M T W T F S \n\n");
temp=DaySearch(year,i,1);
for(j=1;j<=month_day(year,i)+temp;j++)
{
if(j-temp<=0)
printf(" ");
else if(j-temp<10)
printf("%d ",j-temp);
else
printf("%d ",j-temp);
if(j%7==0)
printf("\n");
}
}
return 0;
}
int main()
{
int option,da;
char ch;
int year,month,day;
printf("Copyright @ 2005 TianQian All rights reserved!:):):)");
printf("\n\nWelcome to use the WanNianLi system!\n");
while(1)
{
printf("\nPlease select the service you need:\n");
printf("\n1 Search what day the day is");
printf("\n2 Search whether the year is leap year or not");
printf("\n3 Print the calander of the whole year");
printf("\n4 Exit\n");
scanf("%d",&option);
switch(option)
{
case 1:
while(1)
{
printf("\nPlease input the year,month and day(XXXX,XX,XX):");
scanf("%d,%d,%d,%c",&year,&month,&day);
da=DaySearch(year,month,day);
printf("\n%d-%d-%d is %s,do you want to continue?(Y/N)",year,month,day,week[da]);
fflush(stdin);
scanf("%c",&ch);
if(ch=='N'||ch=='n')
break;
}
break;
case 2:
while(1)
{
printf("\nPlease input the year which needs searched?(XXXX)");
scanf("%d",&year);
if(IsLeapYear(year))
printf("\n%d is Leap year,do you want to continue?(Y/N)",year);
else
printf("\n%d is not Leap year,do you want to continue(Y/N)?",year);
fflush(stdin);
scanf("%c",&ch);
if(ch=='N'||ch=='n')
break;
}
break;
case 3:
while(1)
{
printf("\nPlease input the year which needs printed(XXXX)");
scanf("%d",&year);
PrintAllYear(year);
printf("\nDo you want to continue to print(Y/N)?");
fflush(stdin);
scanf("%c",&ch);
if(ch=='N'||ch=='n')
break;
}
break;
case 4:
fflush(stdin);
printf("Are you sure?(Y/N)");
scanf("%c",&ch);
if(ch=='Y'||ch=='y')
exit(0);
break;
default:
printf("\nError:Sorry,there is no this service now!\n");
break;
}
}
return 0;
}
❻ c語言編寫萬年歷
#include"stdio.h"
#include"stdlib.h"
#include"windows.h"
void welcome();
void getday(int year,int month);
void shuru();
void end();
long year;
long month;
void welcome()
{
printf("【萬年歷程序載入中");
for(int i=0;i<30;i++)
{
printf("★");
Sleep(100);
}
system("cls");
printf("【萬年歷程序載入中】\n");
Sleep(1000);
printf("☆~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~☆\n");
Sleep(1000);
printf(" ~~~謝謝使用【菠菜】製作的萬年歷~~~~\n");
Sleep(100);
printf("☆~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~☆\n");
Sleep(1000);
}
void end()
{
printf("【萬年歷關閉中");
for(int i=0;i<30;i++)
{
printf("★");
Sleep(100);
}
system("cls");
printf("【萬年歷關閉完成】\n");
Sleep(1000);
printf("☆~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~☆\n");
Sleep(1000);
printf(" ~~~謝謝使用【菠菜】製作的萬年歷~~~~\n");
Sleep(100);
printf("☆~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~☆\n");
Sleep(1000);
exit(0);
}
void shuru()
{
int a;
printf("☆~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~☆\n");
printf(" ≮歡迎使用萬年歷≯\n");
printf("☆~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~☆\n");
while(1)
{
printf("請輸入年份:");
scanf("%d",&year);
if(year>0)
break;
else
{
printf("\n");
printf("你輸入的年份有誤,請重新輸入\n"); } }
printf("\n");
while(1)
{
printf("請輸入月份:");
scanf("%d",&month);
if(month>=1&&month<=12)
break;
else
{
printf("\n");
printf("你輸入的月份有誤,請重新輸入\n"); } }
getday(year,month);
}
void getday(int year,int month)
{
int week; //星期幾
int nowday=0; //該月前的總天數
long allday; //從公元1年起的總天數
int dayofmonth[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if(year%4==0&&year%100!=0||year%400==0)
dayofmonth[2]=29;
for(int m=0;m<month;m++)
{
nowday=nowday+dayofmonth[m];
}
allday=nowday+year*365+year/4-year/100+year/400; //公元一年到現在用了多少天
week=allday%7; //求出這個月第一天是星期幾
printf(" %d 年 %d 月\n",year,month);
printf("日 一 二 三 四 五 六\n");
for(int j=0;j<week;j++)
{
printf(" ");
}
for(int i=1;i<=dayofmonth[month];i++)
{
if(week==7)
{
printf("\n");
week=0; }
printf("%2d ",i);
week++; }
printf("\n");
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
}
void main()
{
char a;
welcome();
while(1)
{
shuru();
printf("你還需要繼續嗎?<y ro n>");
fflush(stdin); //清空輸入緩沖區,避免緩沖區內殘存讀取函數無法取走的內容!
scanf("%c",&a);
if(a=='n')
break;
}
end();
}
這個萬年歷比較好看哈!你可以試試這個?
❼ 用C語言怎麼編寫萬年歷
C語言編寫萬年歷的源代碼如下:
#include <stdio.h>
int week(int y,int m,int d);
int main()
{
char wk[7][3] = {{"天"},{"一"},{"二"},{"三"},{"四"},{"五"},{"六"}};
int year, month, day, w;
scanf("%d %d %d", &year, &month, &day);
w = week(year, month, day);
printf("%d年%d月%d日 星期%s", year, month, day, wk[w]);
}
int week(int y,int m,int d)
{
static int r[13]={0,0,3,3,6,1,4,6,2,5,0,3,5};
int c,w;
y %= 400;
if ((y==0||y%4==0&&y%100!=0)&&m<3)
c = 5;
else
c = 6;
w = (y+y/4-y/100+r[m]+d+c)%7;
return w;
}
(7)c語言課程設計製作萬年歷擴展閱讀
電子時鍾C語言版的源代碼如下:
#include<stdio.h>
#include<time.h>
#include<string.h>
int main()
{
char str[50];
time_t t;
struct tm *nt;
while(1)
{
system("cls");//清屏函數
t=time(NULL);
nt=localtime(&t);
strftime(str,50,"%Y-%m-%d %H:%M:%S 「,nt);
printf("現在時刻:%s ",str);
}
getch();
return 0;
}
❽ C語言課程設計-萬年歷
1.系統封面設計
內容:題目名稱(中英文)、進入(中英文)、作者:***、時間:****-**-**
2.輸入界面
內容:(1)密碼口令輸入及容錯(3次)
(2)年份的輸入及容錯(3次)
3.日歷計算設計
(1)求某月某日實行奇跡的函數(邱每月一號的星期數)。演算法:(y-1)+(y-1)/4-(y-1)/100+(y-1)/400+c 得出S (y為年份,c為某月某日是這一年的第幾天,S為總的天數)
(2)邱某月某日至這一年第幾天的函數(求c) 閏年的演算法: y/400==0 ?或y/400==0&&y/100!=0
根據(1)(2)求出每個月的日期
4、日歷格式顯示設計
要求:每屏顯示4個月。
-------------------------------
❾ 用c語言編寫萬年歷
寫萬年歷程序,您需要先了解萬年歷的特點
下面是萬年歷的特點(復制粘貼的):
1. 平年365天(52周+1天),閏年366天(52周+2天)。平年2月28天,閏年2月29天。
由於公元1月1日設為星期六,故3月1日為星期三。 ——注意這個「三」
為使演算法達到最簡,故本演算法以「星期」為計算單位。且選3月1日為基月。
2. 每400年整一閏,或每4年且不為百年的一閏。(原因:地球繞太陽一周的時間是365天5小時46秒,為了使一年的天數為整數,將一年的天數定為365天,餘下的時間積累起來,四年就是23小時15分4秒,將近一天,把這一天加在某年的二月而成29天,該年稱為閏年,其它年稱為平年。但四年加一天又多用了44分56秒,這個數積滿400年為三天。因此400年中只能有97個閏年,所以凡能被400整除,或不能被100整除但能被4整除的年份為閏年。)
所以百年%4=0閏或(年%4=0並且年<>0)閏。
3. 每 4年(3個平年+1個閏年)共208周+5天 ——注意這個「5天」
每百年共100*(208周+5天)-1天=5217周+5天 ——注意這個「5天」(整百年暫設為平年)
每400年共4*(5217周+5天)+1天(整400年閏)=20871周+0天——注意這個「0天」和「1天」(4個整百年只有一個閏年)
即400年一輪回!(原來萬年歷400年前是一家)
至於你說的日期和星期對齊,給你一點思路參考:每一行是7天,可以設定每一天佔10個字元(同時上面的星期也得占滿10個字元),假設本月第一天是星期4,那麼在輸出1之前需要先輸出10×3個字元來佔位,當輸出星期天的日期之後換行,之後的就簡單了
❿ C語言課程設計,萬年歷算星期幾,只要隨便說出公元幾幾年幾月幾日就可以馬上算出是星期幾. 阿里噶道/跪
萬年歷算星期幾
只要隨便說出公元幾幾年幾月幾日就可以馬上算出是星期幾.
只要計算出日的代碼,月份代碼,年份代碼.三個加起來除以七的余數就是星期幾,(如余數是三,則就是星期三).
日的代碼計算:日的代碼最簡單,就是它本身,是幾號就是幾.
月份代碼計算:月份代碼也很簡單,下面有十二個數:1 4 4 7 2 5 7 3 6 1 4 6,分別代表一至十二月份每個月的代碼.比如,九月份的代碼為6.(據來賓介紹,他是用逆推的方法,計算出這12個月份代碼的,即知道某年某月某日是星期幾,反過來推算月份代碼.)
年份代碼計算:年份代碼相對比較復雜,先記住2000年對應的年份代碼是4,這是基礎代碼,牢記即可.
假如大於2000年,比如2010年,則對應的年份代碼是(2010-2000)÷4=2……2,再用基數代碼4減去2倍的商加上余數再加1.即4-2×2+2+1=3,則2010年對應的年份代碼為3.如果沒有餘數,即潤年,則余數後面的1也不用加.比如2008年,對應的年份代碼為0.
假如小於2000年,比如1991年,則對應的年份代碼是(2000-1991)÷4=2……1,再用基數代碼4加上2倍的商減去余數.即4+2×2-1=7,則1991年對應的年份代碼為7.
再記住1個特殊情況,即潤年的3到12月份到最後要加1.
1949年10月1日.
則(2000-1949)÷4=12……3,再4+2×12-3=25,年份代碼計算結果為25,加上10月份的代碼1,再加上日的代碼1,等於27.再除以七的余數為6,則這一天為星期六.