当前位置: 首页 > news >正文

国内最大网站制作公司郴州网站设计

国内最大网站制作公司,郴州网站设计,网站基站的建设方案,外贸网站建设便宜由于本人要接手一项C方面 的工作。由于不会C,不过做过JAVA 以及一些web方面的开发#xff0c;加之时间比较短。所以需要速成#xff0c;于是学习笔记也基本都是用代码代替。 //范例资源文件 /****************************************************************************…由于本人要接手一项C方面 的工作。由于不会C,不过做过JAVA 以及一些web方面的开发加之时间比较短。所以需要速成于是学习笔记也基本都是用代码代替。 //范例资源文件 /***************************************************************************************** Test.txt : tom 123456789 lilei 234567891 zhangsan 345678912 tom 456789123 xiaohe 567891234                                                                     ******************************************************************************************/ //未用名字空间使用vector 进行遍历 /****************************************************************************************** #include stdafx.h #include iostream #include string #include vector #include fstream int _tmain(int argc,_TCHAR* argv[]) { std::string strtmp; std::ifstream fs(Test.txt); std::vectorstd::string vect; while(getline(fs,strtmp,\n)) { vect.push_back(strtmp.substr(0,strtmp.find( ))); } for(std::vectorstd::string::size_type index 0; index vect.size();index) { std::cout vect[index]   std::endl; } return 0; } ******************************************************************************************/ //使用名字空间,使用vector进行遍历 /****************************************************************************************** #include stdafx.h #include iostream #include string #include vector #include fstream using namespace std; int _tmain(int argc,_TCHAR* argv[]) { string strtmp; ifstream fs(Test.txt); vectorstring vect; while(getline(fs,strtmp,\n)) { vect.push_back(strtmp.substr(0,strtmp.find( ))); } for(int index 0; index vect.size();index) { cout vect[index]   endl; } return 0; } ******************************************************************************************/ //利用迭代器对vector进行遍历 /****************************************************************************************** #include stdafx.h #include iostream #include string #include vector #include fstream using namespace std; int _tmain(int argc,_TCHAR* argv[]) {  string strtmp;  ifstream fs(Test.txt);  vectorstring vect;  while(getline(fs,strtmp,\n))  {   vect.push_back(strtmp.substr(0,strtmp.find( )));  }  vectorstring::iterator it vect.begin(); for(;it ! vect.end();it)  {   cout *it  endl;  }  return 0; } ******************************************************************************************/ //使用map 进行遍历 /****************************************************************************************** #include stdafx.h #include iostream #include string #include vector #include fstream #include map using namespace std; int _tmain(int argc,_TCHAR* argv[]) {  string strtmp;  ifstream fs(Test.txt);  mapstring,string  map_temp;  string::size_type index string::npos; while(getline(fs,strtmp,\n))  {  index strtmp.find();  map_temp[strtmp.substr(0,index)] (strtmp.substr(index));  }  mapstring,string ::iterator it map_temp.begin(); for(; it ! map_temp.end(); it)  {   cout it-first it-second endl;  }  return 0; } ******************************************************************************************/ //使用for_each 利用重载操作符 进行map遍历 /****************************************************************************************** #include stdafx.h #include iostream #include string #include vector #include fstream #include map #include iterator #include algorithm using namespace std; class showIiem { public: void operator()(const mapstring,string::value_type value) { cout value.first value.second \n; }; }; int _tmain(int argc,_TCHAR* argv[]) {  string strtmp;  ifstream fs(Test.txt);  mapstring,string  map_temp;  string::size_type index string::npos; while(getline(fs,strtmp,\n))  {   index strtmp.find();   map_temp[strtmp.substr(0,index)] (strtmp.substr(index));  }  showIiem show;  for_each(map_temp.begin(),map_temp.end(),show);  return 0; } ******************************************************************************************/ // 利用copy使用重载操作符 进行map遍历 /****************************************************************************************** #include stdafx.h #include string #include fstream #include iostream #include algorithm #include map #include vector using namespace std; namespace std {  std::ostream operator(std::ostream os, const std::mapstd::string,std::string::value_type value)  {   os value.first value.second;   return os;  } } class ShowValue { public:  ShowValue(std::ostream os):m_os(os)  {  } void operator()(const std::mapstd::string,std::string::value_type value)  {   m_os value.first value.second \n;  }  std::ostream m_os; }; typedef std::ostream_iteratorstd::mapstd::string,std::string::value_type ositertype; std::ostream operator(std::ostream os, const std::mapstd::string,std::string value) {  std::for_each(value.begin(), value.end(), ShowValue(os));  return os; } int _tmain(int argc,_TCHAR* argv[]) {  std::string strtmp;  std::fstream in(Test.txt);  std::mapstd::string,std::string  map_1;  std::string::size_type idx std::string::npos;  while(std::getline(in, strtmp, \n))  {   idx strtmp.find( );   map_1[strtmp.substr(0, idx)] strtmp.substr(idx);  }  ositertype os_iter(std::cout, \n);  std::copy(map_1.begin(), map_1.end(), os_iter);  return 0; }
http://www.pierceye.com/news/447315/

相关文章:

  • 福州电子商务网站手机触屏版网站开发
  • 佛山网站建设骏域开发公司综合部内部管理章程
  • 网站建设 迅雷下载西安建设工程信息网网上招投标
  • 浅析个人网站的设计论文二本网络工程就业前景
  • 网站没有做301的后果是什么苏州工业园区两学一做教育网站
  • 品牌网站建设定位湖南做网站的公司有哪些
  • mvc做的网站郑州作网站
  • 门户网站栏目建设购物类网站开发
  • 专业的网站建设企业新浪网 网站建设
  • 长春网站建设wang汕头网站建设网站
  • 自助建站网站哪个好网站做nat映射需要哪些端口
  • 免费手机网站平台注册嘉兴建站公司
  • 什么网站可以做兼职美工网站建设方案500字
  • 宁波做网站优化网站专题页怎么做
  • 西安网站建设q.479185700強网站改版301是什么意思
  • 网站推广服务 商务服务网站建设官方网站
  • 建设电影网站的关键苏州网站建设业务的公司
  • 水头哪里有做网站的店铺装修设计软件
  • 做网站的大骗子男女做爰视频免费网站
  • 建设一个网站选择的服务器安徽建站
  • 网站制作网站价格用网页制作个人网站
  • 衡水做网站报价网络工程毕设做网站
  • 做网站设计怎么样网站建设先进技术
  • 廊坊cms建站系统wd wordpress
  • vue做网站的好处是什么顺企网下载
  • 在线建站模板下载网站的软件
  • 阿里云网站全部清空怎么做重庆市渝快办官网
  • 关于网站优化的文章室内设计公司排名都有哪些
  • 英文外贸网站建设中国建筑出版在线官网app
  • 浙江网站建设服务公司shopex网站搬家