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 · 601 阅读 · 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 · 379 阅读 · 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 · 337 阅读 · 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 · 333 阅读 · 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 · 336 阅读 · 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 · 344 阅读 · 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 · 331 阅读 · 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 · 388 阅读 · 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 · 415 阅读 · 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 · 444 阅读 · 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 · 467 阅读 · 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 · 406 阅读 · 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 · 401 阅读 · 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 · 424 阅读 · 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 · 368 阅读 · 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 · 366 阅读 · 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 · 297 阅读 · 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 · 320 阅读 · 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 · 324 阅读 · 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 · 567 阅读 · 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 · 346 阅读 · 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 · 647 阅读 · 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 · 415 阅读 · 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 · 388 阅读 · 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 · 300 阅读 · 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 · 369 阅读 · 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 · 424 阅读 · 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 · 367 阅读 · 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 · 286 阅读 · 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 · 309 阅读 · 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 · 557 阅读 · 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 · 993 阅读 · 1 评论
分享