vector的调试,输出 字符串组
来源:互联网 发布:抗弯强度计算软件 编辑:程序博客网 时间:2024/06/04 18:28
#include<iostream>
#include<vector>
#include<string>
using namespace std;
//using std::iostream;
//using std::string;
//using std::vector;
int main()
{
cout<<"please push in words"<<endl;
string word;
vector<string> jeff;
while(1) //也可以直接ctrl+d 结束 ,不用if(word=="abc")
{
cin>>word;
if(word=="abc")
break;
jeff.push_back(word);
}
vector<string>::size_type n;
n=jeff.size();
//int n=jeff.size(); //也可以用直接用int
//cout<<"erro"<<n<<endl; //在前后插入看是哪里错了,还是挺好用的。
while(n>0) //n>0也可以,很奇怪
{
cout<<jeff[n-1]<<endl; //必须-1!
n--;
}
return 0;
}
#include<vector>
#include<string>
using namespace std;
//using std::iostream;
//using std::string;
//using std::vector;
int main()
{
cout<<"please push in words"<<endl;
string word;
vector<string> jeff;
while(1) //也可以直接ctrl+d 结束 ,不用if(word=="abc")
{
cin>>word;
if(word=="abc")
break;
jeff.push_back(word);
}
vector<string>::size_type n;
n=jeff.size();
//int n=jeff.size(); //也可以用直接用int
//cout<<"erro"<<n<<endl; //在前后插入看是哪里错了,还是挺好用的。
while(n>0) //n>0也可以,很奇怪
{
cout<<jeff[n-1]<<endl; //必须-1!
n--;
}
return 0;
}
- vector的调试,输出 字符串组
- Debug 输出字符串 调试信息
- vector常用的输出方式
- 数组的调试输出
- ORACLE 调试输出,字符串执行函数
- VC调试--输出调试字符串(含示例代码)
- vector 类型输出的一个问题
- 较好的vector容器输出代码片段
- vector的几种输出方式
- 字符串的逆向输出
- 字符串的遍历输出
- 字符串的逆序输出
- 字符串的倒序输出
- 字符串的反转输出
- 字符串的输出
- 字符串的倒序输出!
- 字符串的输出处理
- 字符串的输出
- Android推送方式比较
- nagios 安装
- 不同格式证书导入keystore方法(1)
- jquery操作类似tab布局
- jacob替换word的关键字
- vector的调试,输出 字符串组
- oracle 执行计划
- AIX 修改操作系统时间
- oracle数据库的物理迁移
- Eboot中应用NandFlash
- 我我我
- 已知一个正整数N, 且N = 2i + 2j + … + 2q ,求i, j, ... q的值
- EntityManager一些常用的API
- MFC 绘图