Ⅰ 北郵同學C語言題啊~我哭啊~在線等答案啊
//---------------------------------------------------------------------------
#include <stdio.h>
int CheckLeap(int year)
{
return ((year%4==0)&&(year%100)||(year%400==0));
}
int GetWeekDay(int year,int month,int day)
{
if (month<3) {
month+=12;
year--;
}
return (day+2*month+3*(month+1)/5+year+year/4-year/100+year/400+1) % 7 ;
}
int GetMonthDays(int year,int month)
{
switch (month) {
default:
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:return 31;break;
case 4:
case 6:
case 9:
case 11:return 30;break;
case 2:return CheckLeap(year)?29:28;break;
}
}
void PrintMonthCalender(int startDay,int days)
{
int i,j=0;
printf("Sun.\tMon.\tTue.\tWed.\tThu.\tFri.\tSat.\n");
for (i = 0; i<startDay; i++) {
putchar('\t');
j++;
}
for (i=1; i<=days; j++,i++) {
if (j&&j%7==0) {
putchar('\n');
}
printf("%d\t",i);
}
}
int main(int argc, char* argv[])
{
int year,month;
printf("Input the year and month<yyyy-mm>:");
scanf("%d-%d",&year,&month);
printf("\t\t%d-%02d\n",year,month);
PrintMonthCalender(GetWeekDay(year,month,1),GetMonthDays(year,month));
return 0;
}
//---------------------------------------------------------------------------
Ⅱ 計算方法第二版課題6答案
題目
Ⅲ 求北郵電大網路2011春季學期計算機文化基礎階段五答案
1D 2B 3C 4A 5C 6C 7B 8A 9D 10A 對第一到第六題答案我不太確定!希望能對你有幫助1