更新时间:2023-02-13 23:38:39
您必须减少您的循环变量.其余的数学并不是太困难.也不必以任何特殊方式处理第一次迭代:
You have to decrease your loop variable. The rest is not too difficult math. Its also not necessary to handle the first iteration in any special way:
for (int i = generateQuater; i > 0; i--)
{
lstQuaterYear.Add(string.Format("Q{0}-{1}", currentQuater, currentYear));
if (--currentQuater == 0)
{
currentQuater = 4;
currentYear--;
}
}