扛着PKM打人机  •  5天前


include <bits/stdc++.h>

using namespace std;

struct hode {

int a, b;
hode *next;

} head, p;

int main() {

for (int i = 1; i <= 10; i++) {
	p = new hode;
	cin >> p->a >> p->b;
	p->next = head;
	head = p;
}
int a = 0, b = 0;
p = head;
while (p != NULL) {
	a += p->a;
	b += p->b;
	p = p->next;
}
cout<<a<<"+"<<b<<"i";	
return 0;

}


评论:

请先登录,才能进行评论