用C++编程序a+b的和。
答案:2 悬赏:10
解决时间 2021-01-20 11:58
- 提问者网友:未信
- 2021-01-19 20:57
用C++编程序a+b的和。
最佳答案
- 二级知识专家网友:骨子里都是戏
- 2021-01-19 21:16
#include
int main()
{
vectornum;
int n;
cin >> n;
while (n--){
int x, y;
cin >> x >> y;
num.push_back(x + y);
}
cout << endl;
for (vector::iterator it = num.begin(); it != num.end(); it++)
cout << *it << endl;
num.clear();
return 0;
}
追问:它说格式有错误呀
int main()
{
vector
int n;
cin >> n;
while (n--){
int x, y;
cin >> x >> y;
num.push_back(x + y);
}
cout << endl;
for (vector
cout << *it << endl;
num.clear();
return 0;
}
追问:它说格式有错误呀
全部回答
- 1楼网友:毛毛
- 2021-01-19 21:30
我暂时保留我的看法!
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯