练习3.24
来源:互联网 发布:大数据涂子沛主要观点 编辑:程序博客网 时间:2024/06/07 03:06
/************************************************************************* > File Name: 3_24.cpp > Author: > Mail: > Created Time: Sun 09 Apr 2017 08:26:47 PM CST ************************************************************************/#include<iostream>#include<vector>using namespace std;int main(){ vector<int> ivec; int n; cin>>n; for(int i = 0; i < n; ++i)// input num by function i*i-5 { ivec.push_back(i * i - 5); cout<<i * i - 5<<" "; } cout<<endl<<endl; for(auto it = ivec.cbegin(); it != ivec.cend() - 1;) { cout<<(*it) + (*(++it))<<" "; } cout<<endl<<endl; for(auto it_beg = ivec.cbegin(), it_end = ivec.cend() - 1; ; ++it_beg, --it_end) { if(it_beg < it_end) cout<<*it_beg + *it_end<<" "; else if(it_beg == it_end) cout<<*it_beg + *it_end<<" "; else break; } cout<<endl; return 0;}
0 0
- 练习3.24
- 【SICP练习】111 练习3.24
- 练习
- “++”“--”练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- 练习
- java spring框架学习
- https
- 仿知乎悬浮功能按钮FloatingActionButton
- Centos下的vim的配置
- 虚拟机连接Xshell
- 练习3.24
- mongodb权威指南-基础
- 拦截器与过滤器的区别以及他们的配置
- HTTP协议请求方法简述及get和post方法区别
- C#与C++数据类型比较及结构体转换
- mvc mvvm mvp
- 软件测试常考题
- linux系统vi命令大全
- C++ -- shuffle 和 random_shuffle 随机打乱