1.编写一个2016年的年历程序,接受用户输入的月份和日期两个数字,#include int main(){ int m,d,dn,n,w; char mn[12][10]={"January","February","March","April","May","June","July","August","September","October","November","December"}; char wn[7][10]={"Friday","Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday"}; int md[12]={31,29,31,30,31,30,31,31,30,31,30,31}; printf("输入2016年的一个日期(m d):"); scanf("%d %d",&m,&d); //日期验证 if(d<=0 || d>md[m-1]){ printf("输入日期不存在!\n"); }else{ //计算输入日期距2016年1月1日的天数 dn=0; for(n=0;n
文章插图