C语言设计农历万年历论文,万年历设计报告
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
#include
char* month_str[]={"January","February","March","April","May","June","July","August","September","October","November","December"};
char* week[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
int IsLeapYear(int year) /*find out the year is leap year or not*/
{
if((year%4==0&&year%100!=0)||(year%400==0))
return 1;
else
return 0;
}
int month_day(int year,int month)
{
int mon_day[]={31,28,31,30,31,30,31,31,30,31,30,31};
if(IsLeapYear(year)&&month==2)
return 29;
else
return(mon_day[month-1]);
}
int DaySearch(int year,int month,int day) /*search what day this day is*/
{
int c=0;
float s;
int m;
for(m=1;m
c=c+month_day(year,m);
c=c+day;
s=year-1+(float)(year-1)/4+(float)(year-1)/100+(float)(year-1)/400-40+c;
return ((int)s%7);
}
int PrintAllYear(int year)/*print the all year*/
{
int temp;
int i,j;
printf("\n\n%d Calander\n",year);
for(i=1;i<=12;i++)
{
printf("\n\n%s(%d)\n",month_str[i-1],i);
printf("0 1 2 3 4 5 6 \n");
printf("S M T W T F S \n\n");
temp=DaySearch(year,i,1);
for(j=1;j<=month_day(year,i)+temp;j++)
{
if(j-temp<=0)
printf(" ");
else if(j-temp<10)
printf("%d ",j-temp);
else
printf("%d ",j-temp);
if(j%7==0)
printf("\n");
}
}
return 0;
}
int main()
{
int option,da;
char ch;
int year,month,day;
printf("Copyright @ 2005 TianQian All rights reserved!:):):)");
printf("\n\nWelcome to use the WanNianLi system!\n");
while(1)
{
printf("\nPlease select the service you need:\n");
printf("\n1 Search what day the day is");
printf("\n2 Search whether the year is leap year or not");
printf("\n3 Print the calander of the whole year");
printf("\n4 Exit\n");
scanf("%d",&option);
switch(option)
{
case 1:
while(1)
{
printf("\nPlease input the year,month and day(XXXX,XX,XX):");
scanf("%d,%d,%d,%c",&year,&month,&day);
da=DaySearch(year,month,day);
printf("\n%d-%d-%d is %s,do you want to continue?(Y/N)",year,month,day,week[da]);
fflush(stdin);
scanf("%c",&ch);
if(ch=='N'||ch=='n')
break;
}
break;
case 2:
while(1)
{
printf("\nPlease input the year which needs searched?(XXXX)");
scanf("%d",&year);
if(IsLeapYear(year))
printf("\n%d is Leap year,do you want to continue?(Y/N)",year);
else
printf("\n%d is not Leap year,do you want to continue(Y/N)?",year);
fflush(stdin);
scanf("%c",&ch);
if(ch=='N'||ch=='n')
break;
}
break;
case 3:
while(1)
{
printf("\nPlease input the year which needs printed(XXXX)");
scanf("%d",&year);
PrintAllYear(year);
printf("\nDo you want to continue to print(Y/N)?");
fflush(stdin);
scanf("%c",&ch);
if(ch=='N'||ch=='n')
break;
}
break;
case 4:
fflush(stdin);
printf("Are you sure?(Y/N)");
scanf("%c",&ch);
if(ch=='Y'||ch=='y')
exit(0);
break;
default:
printf("\nError:Sorry,there is no this service now!\n");
break;
}
}
return 0;
}
C语言设计农历万年历论文,万年历设计报告相关推荐
- 基于JSP开发在线答疑系统的设计与实现+论文+PPT+开题报告+任务书 大作业源码 毕业设计
基于JSP开发在线答疑系统的设计与实现+论文+PPT+开题报告+任务书(大作业/毕业设计) 开发环境: Windows操作系统 开发工具:Myeclipse+Jdk+Tomcat+SQLServer数 ...
- 基于STM32的多功能MP3设计 毕业设计(论文)开题报告
中国计量学院 毕业设计(论文)开题报告 学生姓名:卢杰学 号:XXXXXXXXX 专 业:电子科学与技术 班 级:10电子1 设计(论文)题目: 基于STM32的多功能MP3设计 指导教师 ...
- 计算机网页设计与制作论文,网页设计与制作论文
二十一世纪是信息化的时代,通过互联网,就能达到足不出户便可了解世界的目的.为了加深对互联网的了解,<网页设计与制作>这门课的出现就成为了必然. 1<网页设计与制作>现状问题分析 ...
- java2048设计说明_基于Android的2048游戏设计与实现论文+任务书+开题报告+答辩+源码...
摘 要 随着经济的发展,生活节奏的不断加快,人们的生活压力也不断加重,而轻松益智游戏对缓解生活压力,调节情绪具有重要意义. <2048>益智小游戏在2014年发布出来后,迅速在网上走红, ...
- 计算机毕业设计、计算机课程设计怎么做?计算机设计1900套来帮你!
计算机毕业设计.计算机课程设计怎么做?计算机设计1900套来帮你! 人生做什么事都有套路,大学毕业设计.课程设计通常比较简单,大多数都是找个项目做参考,有的人随便抄一抄糊弄一下,只要查重,格式别出错就 ...
- 万年历定时关机c语言代码,C语言程序设计能力教程电子万年历设计.doc
C语言程序设计能力教程电子万年历设计.doc 电子科技大学成都学院课程设计报告电子科技大学成都学院电子工程系课程设计报告课 程 名 称 C语言程序设计能力教程 设 计 题 目 万 年 历 指 导 教师 ...
- 万年历设计单片机c语言,基于单片机的电子万年历设计(含电路图,Proteus仿真程序)...
基于单片机的电子万年历设计(含电路图,Proteus仿真程序)(论文11000字,Proteus仿真程序) 摘 要 万年历作为日常生活中重要的时间显示设备,在人们的外出旅游和日常生活中都发挥了重 ...
- c语言编写万年历课程设计,用C语言编写万年历 C课程设计.pdf
用C语言编写万年历 C课程设计 用用 C++语言编写万年历语言编写万年历 用用 语言编写万年历语言编写万年历 学生姓名:学生姓名: 指导老师:指导老师: 学生姓名学生姓名:: 指导老师指导老师:: 摘 ...
- 单片机c语言 课程设计报告,C语言编写单片机万年历系统课程设计报告98分
<C语言编写单片机万年历系统课程设计报告98分>由会员分享,可在线阅读,更多相关<C语言编写单片机万年历系统课程设计报告98分(30页珍藏版)>请在人人文库网上搜索. 1.多功 ...
最新文章
- 【J2SE】学习基础
- Halcon —— pick_and_place_scara_stationary_cam.hdev
- matlab复数方程组,【求解】matlab求解非齐次方程组,但是系数矩阵是复数,求帮忙...
- Facebook揭秘其应用测试平台,并开源核心技术
- JS如何控制checkbox的全选反选
- 近找到了一个免费的python教程,两周学会了python开发【内附学习视频】
- java自定义findbugs规则,定制 findbugs规则 - 阿里巴巴一个测试架构师 - 51Testing软件测试网 51Testing软件测试网-软件测试人的精神家园...
- HDU 2181 哈密顿绕行世界问题
- 【编程语言】【Ruby】语言介绍
- 推荐一个专业的正则表达试学习网站
- 我的创作纪念日——文章汇总
- 坏道与硬盘的P表和G表
- 深度学习视觉领域常用数据集汇总
- java生成一年中假日表(包括周末和法定假期),用于计算一年中的工作日
- 一个游戏程序员的学习资料【转】
- 青龙面板教程(五):代理设置
- python eof是什么_python eoferror是什么异常
- Xmanager 5 远程连接linux图形界面
- linux网络基础设置篇-----(查看网络连接情况,域名解析nslookup,本地映射,启用禁用网络接口,路由跟踪)
- MSF Risk Management Discipline
热门文章
- AIR切换SDK版本时遇到的问题
- OpenMP并行加速笛卡尔乘积
- 利用 OpenMP 实现埃拉托斯特尼(Eratosthenes)素数筛法并行化
- layui中接收modelView中返回的对象并赋值给容器
- Newtonsoft.Json 方法使用()
- perlretut - Perl regular expressions tutorial ---- 中文版
- Spring依赖查找中的常见异常
- vue vuex 挂载_GitHub - BingoVue/vuex: 用Vue实现简版vuex
- 开发者须知:关于 Android L 的一切
- Class com.fasterxml.jackson.databind.ser.BasicSerializerFactory can not access a member of class com