51Testing软件测试论坛
标题:
今年软考题目,如何画控制流图
[打印本页]
作者:
threeg
时间:
2014-11-8 19:03
标题:
今年软考题目,如何画控制流图
int GetMaxDay( int year, int month )
{
1 int maxday = 0;
2,3 if ( month >= 1 && month <= 12 )
{
4 if ( month == 2 )
{
5 if ( year % 4 == 0 )
{
6 if ( year % 100 == 0 )
{
7 if ( year % 400 == 0 )
8 maxday = 29;
else
9 maxday = 28;
}
else
10 maxday = 29;
}
else
11 maxday = 28;
}
12 else
{
13,14,15,16 if ( month == 4 || month == 6 || month == 9 || month == 11 )
17 maxday = 30;
else
18 maxday = 31;
}
}
19 return maxday;
}
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2