Case month Of
Case 1:month Is1,3,5,7,8,or 10:’31 day months (excpet 12)
If day<31 then tomorrowDay=day+1 else tomorrowDay=1 tomorrowMonth=month+1
EndIf Case 2:month Is 4,6,9 or 11 ’30day
EndIf Until c1 AND c2 AND c3 Output(“Side A is ”,a) Output(“Side B is ”,b) Output(“Side C is ”,c) …… ‘Step2 …… ’Step3 End triangle3
9 .
2.2 NextDate函数
IT Education & Training
• 输入变量之间的逻辑比较复杂 • 有两种复杂性来源:输入域和闰年规则 • 80%活动出现在20%的空间
10 .
IT Education & Training
2.2.1 NextDate 问题陈述
• NextDate是一个有三个变量(月份、日期和年) 的函数。函数返回输入日期后面的那个日期。变量 月份、日期和年都是整数值,并满足以下条件:
.
IT Education & Training
18
IT Education & Training
续……
sales= tippleSales+wineSales+beerSales
EndIf
EndIf
Else Output(“NOT a Triangle”)
EndIf