CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C/C++ >  C++ 语言

帮白痴小虾米改改错误程序

楼主cdhit(积极态度)2005-06-01 09:59:16 在 C/C++ / C++ 语言 提问

#include   <iostream>  
  #include   <vector>  
  #include   <iterator>  
   
  using   namespace   std;  
   
  void   main()   {  
  vector<string>   str   =   {"congratulations",   "you",   "are",   "a",   "good",   "guy"};  
  vector<string>::iterator   iter   =   str.begin();  
  vector<string>::iterator   iter_end   =   str.end();  
  for(;iter   !=   iter_end;++iter)  
  std::cout<<*iter<<'\n';  
  } 问题点数:20、回复次数:2Top

1 楼goodboy1881(积木)(谁都别拦着我在水源升星)回复于 2005-06-01 10:10:42 得分 10

#include   <iostream>  
  #include   <vector>  
  #include   <iterator>  
   
  using   namespace   std;  
   
  int   main()   {  
  vector<string>   str;  
  string   temp[]   =   {"congratulations",   "you",   "are",   "a",   "good",   "guy"};  
  for(int   i=0;i<6;i++){  
  str.push_back(temp[i]);  
  }  
   
  vector<string>::iterator   iter   =   str.begin();  
  vector<string>::iterator   iter_end   =   str.end();  
  for(;iter   !=   iter_end;++iter)  
  std::cout<<*iter<<'\n';  
  return   0;  
  }Top

2 楼foochow(无聊,灌水......)回复于 2005-06-01 11:01:08 得分 10

#include   <iostream>  
  #include   <vector>  
  #include   <iterator>  
  #include<string>  
  using   namespace   std;  
  void   main()    
  {  
  string   st[6]={"congratulations",   "you",   "are",   "a",   "good",   "guy"};  
  vector<string>str(st,st+6);  
  for(vector<string>::iterator   iter   =   str.begin();iter!=str.end();++iter)  
  {  
  cout<<*iter<<endl;  
  }  
  }  
  Top

相关问题

  • 分页问题出现错误,请帮忙改改!!
  • 求助,请各位大哥给我改改我下面这段程序的错误,谢谢!
  • 求助,请各位大哥给我改改我下面这段程序的错误,谢谢!
  • 请大家看看下面的代码和错误提示!!帮帮改改,谢谢了!!
  • 错误
  • ','错误
  • 错误???
  • 错误?
  • apache57(虾米) 请进
  • 白痴问题!!!

关键词

  • vector
  • iter
  • congratulations
  • std
  • guy
  • good
  • str
  • cout
  • include
  • st

得分解答快速导航

  • 帖主:cdhit
  • goodboy1881
  • foochow

相关链接

  • C/C++ Blog
  • C/C++类图书
  • C/C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo