vector
来源:互联网 发布:淘宝亲密付退款退到哪 编辑:程序博客网 时间:2024/04/30 01:46
#include<iostream>#include<string>//#include<cctype>#include<vector>using namespace std;int main(){/****************************************************************vector<string> text;string word;while (cin >> word){text.push_back(word);}for (auto c : text){cout << c << " ";}cout << endl;*********************************************************************//************************************************************************unsigned int t;vector<unsigned int> score(11,0);while (cin >> t){if (t <= 100){++score[t / 10];}}for (auto c : score){cout << c << " ";}cout << endl;*************************************************************************//***************************************************************************string smallLetter;vector<string> bigLetter;while (cin >> smallLetter){bigLetter.push_back(smallLetter);}for (auto &c : bigLetter){if (!c.empty()){for (auto &s : c){s = toupper(s);}}}for (auto c : bigLetter){cout << c << " ";}cout << endl;*************************************************************************************************/ int a;vector<int> zhengshu;while (cin >> a){zhengshu.push_back(a);}unsigned int n = zhengshu.size();int i = 0;/**********************相邻两个数的和***********************for (auto &c : zhengshu){int temp = c;c += i;i = temp;cout << c << " ";}*************************第一个加最后一个********************/int j = 0;for (j = 0; j < (n / 2); ++j){cout << (zhengshu[j] + zhengshu[n - 1 - j]) << " ";}if (j * 2 < n){cout << zhengshu[j] << " ";}cout<<endl;/****************************************************************************string word;const string hexDigit="0123456789ABCDEF";string zong;int n;cout << "将字符串里的东西都换成x"<<endl;while (cin >> word){for (auto &c : word){c = 'x';}cout << word << endl;}cin.clear();system("PAUSE");cout << "去掉标点符号" << endl;while (cin >> word){for (auto&c : word){if (ispunct(c)){c = ' ';}}}cout << word << endl;cin.clear();system("PAUSE");cout << "十进制转16进制" << endl;while (cin >> n){if (n <= hexDigit.size()){zong = zong + hexDigit[n]+" ";}}cout << zong << endl;************************************************************************************************/system("PAUSE");return 0;}
0 0
- vector
- vector
- Vector
- Vector
- vector
- vector
- VECTOR
- VECTOR
- VECTOR
- vector
- vector
- Vector
- vector
- vector
- vector
- Vector
- vector
- vector
- parse_url,pathinfo,basename三个函数都解析出了什么
- LeetCode Insertion Sort List(单链表插入排序)
- 农村土地确权之系列文档 —— 承包方代表变更申请书
- Calibration of Short Range 2D Laser Range Finder for 3D SLAM Usage
- 浅谈网络世界中的Power Law现象(一) 什么是Power Law
- vector
- 使用 UNIX 的 10 个良好习惯
- 数据结构-线性表_单链表
- 农村土地确权之系列文档 —— 地界调整申请书
- Java笔记(七)多线程
- 图片及优化---png的Xcode优化
- Ubuntu14.04 编译Android源码
- Android网络通信
- STM32学习笔记