题解 | #牛牛的双链表求和#
牛牛的双链表求和
https://www.nowcoder.com/practice/efb8a1fe3d1f439691e326326f8f8c95
#include <iostream> #include <list> using namespace std; int main() { int a; cin >> a; int b1 = a; list<int> l1; while (cin >> a && b1--) l1.push_back(a); for (int& i : l1) { i += a; cin >> a; } for (auto i : l1) { cout << i << " "; } } // 64 位输出请用 printf("%lld")
没什么好说的,我是写CPP的