#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 人评分
简单的a+b (C语言代码)浏览:760 |
九宫重排 (C++代码)浏览:1336 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:541 |
简单的a+b (C语言代码)浏览:530 |
妹子杀手的故事 (C语言代码)浏览:1234 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:456 |
C语言程序设计教程(第三版)课后习题6.6 (C语言代码)浏览:624 |
1013题解浏览:561 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:401 |
排序算法(选择,插入,冒泡)浏览:775 |