ImageVerifierCode 换一换
格式:DOC , 页数:14 ,大小:353.27KB ,
资源ID:13025531      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/13025531.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(安徽工业大学软件工程实验报告Word文件下载.doc)为本站会员(b****9)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

安徽工业大学软件工程实验报告Word文件下载.doc

1、输入一个年份(1-3000),然后显示12个月的月历能解决闰年和平年问题能输出显示结果、运行需求分析 操作系统: Windows9x, Windows2000, Windows XP及更高版本、数据流图是否闰年确定年份开始信息年份显示其他月份显示12月错误显示表头计算1月1日检查输入任意键非法显示2月显示1月 软件结构图:mainsetinit()output()inputyear()checkinput()setinfo()printmonth()printhead()isleap ()2 软件设计与编码#include ctype.hstdlib.hmath.h#define firstd

2、ayof1 1 /* 定义第一年的第一天, 星期日=7 */#define gap /* set gap between numbers of dates */#define dent /* set right margin. */struct info int month; int firstdayofmonth; int daysofmonth; int leap; monthinfo; int checkinput(void);int inputyear(void);int isleap(int y);void output(struct info);void printhead(str

3、uct info );void printmonth(struct info);struct info setinit(int);struct info setmonthinfo(struct info );/* 这个作用是判断年, 如果是闰年, return 1, 否则 return 0 */int isleap(int y) return (y%4=0 & y%100!=0) | y%400=0);/* This module is to accept inputyear() and check if it is correct. if it is correct it return in

4、t year, otherwise ask user reenter */ int checkinput(void) int y; do y=inputyear(); if(y3000) printf(n输入错误!。nn); y=0; while(y1); return y; /* This function is to accept the input year, if it is the integer, it returns it, otherwise it return -1 */int inputyear(void) char s80; int i, y; y=-1; printf(

5、请输入年份(1-3000): for(i=0;i80;+i) si=getchar(); if(si=27) exit(0); if(si=10) break;+i) if(si=10) break; else if(!isdigit(si) return y; y=atoi(s);/*This module is to accept monthinfo, and print the whole year calender. */void output(struct info monthinfo) char ch; printhead(monthinfo); printmonth(monthi

6、nfo);按任意键显视下一月, 按Esc键退出. n ch=getchar(); if(ch=27) exit(0); monthinfo=setmonthinfo(monthinfo); while(monthinfo.month13);/* This module is to accept monthinfo, amd print monthly head like一 月 */void printhead(struct info monthinfo) char *ss; printf(%s,dent); switch(monthinfo.month) case 1: ss=; case 2

7、:二 月 case 3:三 月 case 4:四 月 case 5:五 月 case 6:六 月 case 7:七 月 case 8:八 月 case 9:九 月 case 10:十 月 case 11:十一 月 case 12: ss=十二 月 %s%s%s%snn,gap,gap,gap,ss);/* This module is to accept monthinfo, and print the numbered dates of the month. */void printmonth(struct info monthinfo) int i,j,k; printf(一%s二%s三%

8、s四%s五%s六%s日nn,gap,gap,gap,gap,gap,gap); for(i=1;monthinfo.firstdayofmonth;i=i+1) printf(%s ,gap); k=monthinfo.firstdayofmonth; for(j=1;j7) k=k-7; printf(nn%s ; k=k+1;%2d%s,j,gap);/* This module is to accept the monthinfo, and set the monthinfo of next month. */ struct info setmonthinfo(struct info m

9、onthinfo) int m; monthinfo.firstdayofmonth= (monthinfo.firstdayofmonth+ monthinfo.daysofmonth-1)%7+1; monthinfo.month=monthinfo.month+1; monthinfo.daysofmonth=30; m=monthinfo.month; if(m=1 | m=3 | m=5 | m=7 | m=8 | m=10 | m =12) monthinfo.daysofmonth=31; if(m=2) if(monthinfo.leap) monthinfo.daysofmonth = 29; else

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1