![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++ Primer
文章平均质量分 53
dylanlrp
这个作者很懒,什么都没留下…
展开
-
习题8.3 & 8.4
// 0802.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;istream &ReadStream( istream& myin ){ int ival; while ( myin >> ival, !myin.eof() ){原创 2010-04-27 21:29:00 · 532 阅读 · 0 评论 -
习题9.34
// 0934.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string strVal = "Hello Everyone"; for (s原创 2010-05-09 16:47:00 · 304 阅读 · 0 评论 -
习题9.35
// 0935.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string strVal = "Hello Everyone";/* st原创 2010-05-09 17:24:00 · 284 阅读 · 0 评论 -
习题9.36
// 0936.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ vector charVect(10,a); string str(char原创 2010-05-09 17:52:00 · 282 阅读 · 0 评论 -
习题9.38
// 0938.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string str("ab2c3d7r4e6"); string strNumber("012345原创 2010-05-09 20:21:00 · 297 阅读 · 0 评论 -
习题9.39
// 0939.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ //思路:查找符号位置,统计单词间隔数,则得单词数; //计算单词长度(两个最近符号原创 2010-05-10 20:40:00 · 296 阅读 · 0 评论 -
习题9.40
// 0940.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string q1("when lilacs last in the dooryard bloomd")原创 2010-05-11 10:13:00 · 291 阅读 · 0 评论 -
习题9.41
// 0941.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;string greet(string form,string lastname,string title,string::size_type pos,int length){ form原创 2010-05-11 17:08:00 · 322 阅读 · 0 评论 -
习题9.42
// 0942.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ stack strstack; string strword; while(原创 2010-05-12 10:12:00 · 350 阅读 · 0 评论 -
习题9.43
// 0943.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string strExpresstion; stack charStack;原创 2010-05-12 10:56:00 · 390 阅读 · 0 评论 -
习题10.1
// 1001.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ pair strint_pair; vector > pa原创 2010-05-13 15:12:00 · 398 阅读 · 0 评论 -
习题10.9
// 1009.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ map word_count; string word; cout << "En原创 2010-05-13 16:47:00 · 341 阅读 · 0 评论 -
习题10.12
// 1012.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std; int _tmain(int argc, _TCHAR* argv[]){ map word_count; s原创 2010-05-13 21:27:00 · 346 阅读 · 0 评论 -
习题10.18
// 1018.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ map > name_map; string surname,ch原创 2010-05-15 16:12:00 · 376 阅读 · 0 评论 -
习题10.19
// 1019.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ map > > name_map; stri原创 2010-05-15 16:46:00 · 321 阅读 · 0 评论 -
习题9.28
// 0928.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ char* word[] = {"1qaz","2wsx","原创 2010-05-06 10:58:00 · 313 阅读 · 0 评论 -
习题9.27
// 0927.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string sa[] = {"hello","dylan","how","are"原创 2010-05-06 09:50:00 · 250 阅读 · 0 评论 -
习题8.10
// 0810.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string strText; vect原创 2010-04-30 15:37:00 · 265 阅读 · 0 评论 -
习题9.15
// 0915.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ list slist; string strInput; while (ci原创 2010-05-03 20:40:00 · 285 阅读 · 0 评论 -
习题8.6
// 0806.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;istream &ReadStream( istream& myin ){ int ival; while ( myin >> iv原创 2010-04-30 08:55:00 · 514 阅读 · 0 评论 -
习题8.13
// 0813.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;ofstream& openfile(ofstream &myout, const string &filename){ myout.clo原创 2010-04-30 16:08:00 · 283 阅读 · 0 评论 -
习题8.16
// 0816.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string strLine,strWord原创 2010-04-30 17:44:00 · 590 阅读 · 0 评论 -
习题9.12
// 0912.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;bool findInVector( int ival,vector::iterator iter_begin,vector::iterator iter_end ){ bool b原创 2010-05-03 17:01:00 · 336 阅读 · 0 评论 -
习题9.13
#include "stdafx.h"#include #include using namespace std;struct structResult{ bool bExist; vector::iterator iterIndex;};struct structResult FindInt(vector::iterator begin,vecto原创 2010-05-03 17:39:00 · 336 阅读 · 0 评论 -
习题9.14
// 0914.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ vector svec; string strInput; while (c原创 2010-05-03 17:58:00 · 218 阅读 · 0 评论 -
习题8.15
// 0815.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std; istream& ReadStream( istream &myin ) { string strWord;原创 2010-04-30 17:15:00 · 318 阅读 · 0 评论 -
习题9.18
// 0918.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ list ilist; deque odd_deque, even_deque;原创 2010-05-03 22:05:00 · 375 阅读 · 0 评论 -
习题8.7
// 0807.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;void process(string strtext){ cout << strtext << endl;}int _tmain(i原创 2010-04-30 10:44:00 · 328 阅读 · 0 评论 -
习题8.9
// 0809.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string strText; vect原创 2010-04-30 15:30:00 · 250 阅读 · 0 评论 -
习题9.20
// 0920.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ vector ivec; list ilist; int ival; c原创 2010-05-05 16:20:00 · 272 阅读 · 0 评论 -
习题9.26
// 0926.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ int a[] = {0,1,1,2,3,5,8,13,21,55,89}原创 2010-05-05 16:21:00 · 451 阅读 · 0 评论 -
10.3.9例子“单词转换”map对象
// example1003.cpp : 定义控制台应用程序的入口点。//书10.3.9例子 单词转换map对象//第一个文件:mapfile单词转换集合,第二个文件inputfile:要转换得文件;//输出到outputfile“out”#include "stdafx.h"#include #include #include #include #includ原创 2010-05-14 20:42:00 · 934 阅读 · 1 评论