1)记得要设置默认编辑器Markdown
2)在写代码前后需要 添加 ```
void insert(int data)
{
Node *newNode = new Node;
newNode->data = data;
newNode->pNext = nullptr;
Node *p = head;
if (head == nullptr)
{
head = newNode;
}
else
{
while (p->pNext != nullptr)
{
p = p->pNext;
}
p->pNext = newNode;
}
}