我正在练习LLL递归,而且我目前仍然坚持这个问题。以下是我到目前为止的情况:
count_last(node* head, int &last_node_data)
{
if(!head) return 0;
if(!head->next)
{last = head->data;
return 0;
}
count_last(head->next,last);
if(head->data == last)
//Increase count by 1;
}
如何增加点数?在使用递归(从列表的末尾)向后工作时,我真的很挣扎。谢谢!
答案 0 :(得分:0)
你可以:
答案 1 :(得分:0)
尝试这样的事情:
while (true)
{
Thread.Sleep(AutoSaveTime);
if (isRunning)
{
try
{
Workbooks files = Globals.ThisAddIn.Application.Workbooks;
foreach (Workbook book in files)
{
if (book.Saved != true
&& book != Globals.ThisAddIn.Application.ActiveWorkbook)
{
book.Save();
}
}
Globals.ThisAddIn.Application.ActiveWorkbook.Save();
}
catch (Exception)
{
}
}
}