我正在使用 c 语言,我们现在的课程是关于结构的。这是我的代码的一部分,“temp”是一个结构,其中也有一个日期结构。但是,在某些情况下,某些有效日期直到最后一个条件才能进入。
if( temp.Date.year >= start.year && temp.Date.year <= end.year)
if( (temp.Date.year >= start.year && temp.Date.year <= end.year) && (temp.Date.month >= start.month && temp.Date.month <= end.month) )
if( (temp.Date.year >= start.year && temp.Date.year <= end.year) && (temp.Date.month >= start.month && temp.Date.month <= end.month) && temp.Date.day >= start.day && temp.Date.day <= end.day)
isDateValid = 1;