题解 | #序列中删除指定数字#
序列中删除指定数字
https://www.nowcoder.com/practice/7bbcdd2177a445a9b66da79512b32dd7
#include <cstdio> #include <iostream> #include <list> using namespace std; int main() { int n, m; int x; list<int> l; cin >> n; for (int i = 0; i < n; i++) { cin >> m; l.push_back(m); } cin >> x; l.remove(x); for (int i : l) { cout << i << " "; } } // 64 位输出请用 printf("%lld")