111

马超  •  9个月前


#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;
}

评论:

请先登录,才能进行评论