数据结构:编写一个函数,把一个线性表L中所有值为m的元素替换为n。
void fun(Node* L, int m, int n) { Node* p = L; while(p) { if(p->data==m) p->data = n; p = p->next; } }