#include
#include
#include
#define str " sun mon tue wed thu fri sat "
void menu(); //操作選單
int leap(int year); //判斷某年是不是閏年
int days_month(int year,int month); //返回某月的天數
int someday(int year,int month,int day); //計算某天是星期幾
void search_month(int year,int month); //輸出某月的日曆
void search_someday(int year,int month,int day); //查詢某日是星期幾
int main()
printf("---------*********************------------\n\n\n");
break;
case 2:
printf("請輸入您所要查詢的相關資訊.\n");
printf("年份:");scanf("%d",&year);
printf("月份:");scanf("%d",&month);
k1=1;
while(k1)
else k1=0;
} search_month(year,month);
printf("---------*********************------------\n\n\n");
break;
case 3:
printf("請輸入你要查詢的日期\n");
printf("年份:");scanf("%d",&year);
printf("月份:");scanf("%d",&month);
k2=1;
while(k2)
else k2=0;
} // printf("%d年%d月有%d天\n",year,month,days_month(year,month)); 除錯觀察輸入的日期是否有誤,可忽略
printf("日期:");scanf("%d",&day);
k3=1;
while(k3)
else k3=0;
} search_someday(year,month,day);
printf("---------*********************------------\n\n\n");break;
case 4:exit(0);
printf("---------*********************------------\n\n\n");break;
default:
k4=1;
while(k4)
break;
}}while(i>0&&i<5);
return 0;
}void menu()
int leap(int year)
int days_month(int year,int month)
else days_month = 28;break;
}return days_month;
}int someday(int year,int month,int day)
} else
else if(i>=10)}}
printf("\n------------------------------------------\n");
}void exit()
C 寫的萬年曆
以前的課程設計 1 雙列顯示 include include include includeusing namespace std int week int,int,int 根據年月日判斷星期幾 int leap year int 判斷閏年 void display year int 顯示某年日曆 ...
萬年曆 C語言
顯示效果 大概步驟 1.顯示主介面 void showmenu char temp 10 2.判斷是否為閏年 bool isleap int year 3.計算總天數 int daysum int year,int month 4.顯示日曆 showcalendar int sum,int year...
用c 寫萬年曆(簡單版)
using system using system.collections.generic using system.text namespace calendarprojects private int pingnian new int private int leapyear new int 計...