实验2 条件覆盖和判定条件覆盖 《软件测试方法和技术》.doc
还剩
35页未读,
继续阅读
下载文档到电脑,马上远离加班熬夜!
亲,很抱歉,此页已超出免费预览范围啦!
如果喜欢就下载吧,价低环保!
内容要点:
printf("The nextData is %d-%d-%d\n",year,month,day);}elsereturn 0;}main(){int year,month,day;printf("Please enter the Year Month Day:");scanf("%d %d %d",&year,&month,&day);if(nextData(year,month,day) == 0)printf("Please enter the correct number!\n");}↑↑↑别人的程序↑↑↑·····················分···割····线····················int nextData(int year,int month,int day){data(year);if(month > 0 && month 0 && day numberOfDays[month]){if(month == MONTH) {year++;month = FIRSTDAY;day = FIRSTDAY;}else {month++;day = FIRSTDAY;}}else day++; if(index%2 == 0) {if(index<=MONTH/2+1)numberOfDays[index] = MINDAYS;elsenumberOfDays[index] = MAXDAYS;}else{if(index<=MONTH/2+1)numberOfDays[index] = MAXDAYS;elsenumberOfDays[index] = MINDAYS;}}if((year%4==0 && year%100!=0) || (year%400==0)) numberOfDays[2] = LEAPFEBRUARY;elsenumberOfDays[2] = FEBRUARY;} else if(triangle(side) == 3)printf("Triangle\n");else printf("It is not a triangle!\n");}#include#define MONTH 12#define MAXDAYS 31#define MINDAYS 30#define FEBRUARY 28#define LEAPFEBRUARY 29#define FIRSTDAY 1#define ADDDAYS 1int numberOfDays[MONTH+1];void data(int year){int index;for(index=1;index<=MONTH;index++){ return 1; elsereturn 2; }elsereturn 3; }elsereturn 4; }main(){int i,side[N
发表评论
暂无评论,赶快抢占沙发吧。