#include<iostream> #include<list> using namespace std; int main() { list<pair<int, int>> L; int n, real, imag, total1 = 0, total2 = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> real >> imag; L.push_back(make_pair(real, imag)); } for (auto it = L.begin(); it != L.end(); it++) { total1 += (*it).first; total2 += (*it).second; } cout << total1 << "+" << total2 << "i" << endl; return 0; }
0.0分
3 人评分
【密码】 (C语言代码)浏览:345 |
WU-printf基础练习2 (C++代码)浏览:2045 |
【金明的预算方案】 (C++代码)浏览:869 |
C语言训练-自由落体问题 (C语言代码)浏览:645 |
最小公倍数 (C语言代码)浏览:1086 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:810 |
DNA (C语言代码)浏览:559 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:621 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:565 |
小O的乘积 (C语言代码)浏览:1051 |