#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语言代码)浏览:887 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:548 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:596 |
简单的a+b (C语言代码)浏览:709 |
printf基础练习2 (C语言代码)浏览:792 |
幸运数 (C++代码)浏览:1277 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:410 |
sizeof的大作用 (C语言代码)浏览:1069 |
C二级辅导-阶乘数列 (C语言代码)浏览:522 |
数组输出 (C语言代码)浏览:713 |