题解 | #牛牛的链表删除#
牛牛的链表删除
https://www.nowcoder.com/practice/d3df844baa8a4c139e103ca1b1faae0f
#include <algorithm>
#include <iostream>
#include <list>
using namespace std;
int main() {
int len;
cin >> len;
int target;
cin >> target;
int data;
list<int> lst;
while (cin >> data) lst.push_back(data);
lst.remove(target);
for (auto& i : lst) {
cout << i << " ";
}
}
// 64 位输出请用 printf("%lld")
AI年代了,简单的已经完全没多大必要
查看12道真题和解析