C语言日历显示程序.pdfVIP

  • 8
  • 0
  • 约4.24千字
  • 约 4页
  • 2023-07-01 发布于湖北
  • 举报
C语⾔ ⽇历显⽰程序 要求:按⼀般的格式显⽰ ⽇历。 (1)输⼊⼀个年份,输出该年整年的⽇历。 (2)输⼊年 ⽉,输出该⽉的⽇历。 (3)输⼊年、⽉ ⽇,输出星期⼏,跟今天差多少天。 #include stdio.h #include time.h int month[13]={0,3 1,28,3 1,30,3 1,30,3 1,3 1,30,3 1,30,3 1}; char mon[13] [8]={zore,⼀⽉,⼆⽉,三⽉,四⽉,五⽉,六⽉,七⽉,⼋⽉,九⽉,⼗⽉,⼗⼀⽉,⼗⼆⽉}; //判断是否为闰年 Isleapyear(int year){ if ((year%4==0 year% 100!=0) || year%400==0) return 1; else return 0; } //判断输⼊ ⽇期总共有多少天 int Alldays(int year,int month,int day) { int i,j =0; int alldays; int monthdays; for(i= 1;iye

文档评论(0)

1亿VIP精品文档

相关文档