111

马超 · 发布于 2024-06-26 · 浏览 569 回复 0
#include <bits/stdc++.h>
using namespace std;

int main() {
	list<int>c;
	list<int>d;
	int a, b, x = 0, y = 0;
	for (int i = 0; i < 10; i++) {
		cin >> a >> b;
		c.push_front(a);
		d.push_front(b);
	}
	for (auto j = c.rbegin(); j != c.rend(); j++) {
		x += *j;
	}
	for (auto j = d.rbegin(); j != d.rend(); j++) {
		y += *j;
	}
	cout << x << "+" << y << "i";
	return 0;
}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复