這是對程式-->乙個日曆c程式的改進,沒有了day_code &leap_year code的限制
可以直接輸入年份列印出年曆
/*calendar1
列印出某年的日曆,由使用者只需輸入年份
@author jeff chen
@version 1.1 date:2012-03-09
*/#includeint main()
//輸出星期
printf("\n\nsun mon tue wed thu fri sat\n");
for(day=1;day0)
printf(" ");
else
printf("\n");
}//設定下乙個星期的星期**
day_code=(day_code+days_in_month)%7;
}return 0;
}
Python輸入乙個年份輸出全年日曆
題目 已知1990年1月1號是星期一,公元1年1月1日也是星期一。要求輸出某年的日曆。def isr year 判斷是否為閏年 if year 400 0 or year 4 0 and year 100 0 return true def isd year 判斷輸入年份的第一天是週幾 s 0 d ...
天數最少的年份 Excel輸入年份得出天數
如何在excel中,輸入年份之後,自動算出本年共有幾天?即算出每年有幾天的意思。先看下表,比如,在c列輸入年分之後,在對應的d列,得出本年共有多少天?這個其實很簡單,使用下面的公式即可 c2 12 31 c2 1 1 1 最後,使用填充的辦法,就能將所有年份的天數都計算出來了。知識拓展 下面針對上面...
輸入年份和天數計算該年份中具體的日期(指標實現)
includevoid getdata int ptryear,int ptryeaday void getmonthday int year,int yearday,int ptrmonth,int ptrday void dispdate int year,int month,int day i...