自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 c++Primer9.2.1

练习9.3begin不能在end之前练习9.4#include<iostream>#include<string>#include<vector>using namespace::std;bool find(vector<int> &pp,int num){ auto a = pp.begin(); auto b = pp.e...

2018-04-15 14:46:04 269

原创 c++Primer6.2.2节练习

练习6.11#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; void rest(int &a);void rest1(int a);int main(){ int a = 5; int b = 8;...

2018-03-19 00:29:36 302

原创 c++Primer6.2.1节练习

练习6.10#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; void sw(int *p1, int *p2);int main(){ int a = 5; int b = 8; cout << ...

2018-03-19 00:14:49 189

原创 c++Primer5.5.2练习

练习5.21#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int main(){ string begin_string,second_string; int flag = 0; while (cin>...

2018-03-16 15:35:15 164

原创 c++Primer5.5.1练习

练习5.20#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int main(){ string begin_string,second_string; int flag = 0; while (cin>...

2018-03-16 15:22:38 185

原创 c++Primer5.4.4节练习

练习5.18(a) do后面的循环语句没有加大括号。(b)condition使用的变量必须定义在循环体外。(c)出了括号ival不能使用。练习5.19#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int main()...

2018-03-16 15:09:10 214

原创 c++Primer5.4.2节练习

练习5.17#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int main(){ vector<int> num1{ 0,1,1,2 }; vector<int> num2{ 0,1,1...

2018-03-16 14:54:49 160

原创 c++Primer5.3.2节练习

练习5.9#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int main(){ int sa = 0, se = 0, si = 0, so = 0, su = 0; string str{ "aeioudhdu...

2018-03-13 00:41:54 270

原创 c++Primer4.3节练习

练习4.8相等性优先级>逻辑与>逻辑或练习4.9if(cp && *cp)如果cp为空指针和cp中的第一个字符不为空则为真。练习4.10#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int ...

2018-03-10 14:46:28 383

原创 c++Primer3.5.5节练习

练习3.41#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int main(){ constexpr size_t n = 10; int a[n] = { 1,2,3,4,5,6,7,8,9,10 };...

2018-03-09 14:01:52 277

原创 c++Primer3.5.2节练习

练习3.30ix不能等于array_size;练习3.31#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int main(){ constexpr size_t n = 10; int a[n]; fo...

2018-03-05 23:01:03 246

原创 c++Primer3.5.1节练习

总结不能将数组内容拷贝给其他数组作为其初始值,也不能用数组为其他数组赋值。const char a4[6] = "Daniel" //错误,没有空间可存放空字符看起来只有6个字符,但数组的大小必须至少是7练习3.27unsigned buf_size = 1024;(a) int ia[buf_size]; //非法,buf_size不是常量(b)int ia[4*7-14]; ...

2018-03-05 22:50:29 284

原创 c++Primer3.4.2节练习

练习3.24#include "stdafx.h"#include<iostream>#include<string>#include<vector>//#include <ctype.h>using namespace::std; int main(){ int n; vector<int> num; dec...

2018-03-05 01:29:51 443

原创 c++Primer3.4.1节练习

总结某些对vector对象的操作会使迭代器失效(1)已知的一个限制是不能在范围for循环中向vector对象添加元素(2)另一个限制是任何一种可能改变vector对象的操作比如push-back,都会使该vector对象的迭代器失效。it -> num和 (*it).num表达意思一样  都是解引用it,调用对象的num成员cbegin 和cendauto it3 = v.cbegin();...

2018-03-03 23:11:07 227

原创 c++Primer3.4.1节练习

总结某些对vector对象的操作会使迭代器失效(1)已知的一个限制是不能在范围for循环中向vector对象添加元素(2)另一个限制是任何一种可能改变vector对象的操作比如push-back,都会使该vector对象的迭代器失效。it -> num和 (*it).num表达意思一样  都是解引用it,调用对象的num成员cbegin 和cendauto it3 = v.cbegin();...

2018-03-03 23:00:01 170

原创 c++Primer3.3.3节练习

3.3.3总结  如果循环体内部包含有向vector对象添加元素的语句,则不能使用范围for循环。练习3.16#include "stdafx.h"#include<iostream>#include<string>#include<vector>using namespace::std; int main(){ vector<int...

2018-03-03 22:26:03 445 5

原创 c++Primer3.2.3节练习

练习3.6#include "stdafx.h"#include<iostream>#include<string>#include "stdafx.h"using namespace::std; int main(){ string str("some string!!!!"); for (auto c : str) { c = 'x'; ...

2018-03-01 23:22:39 470

原创 c++Primer练习3.2.2节

3.4两个字符串可以比较大小1.如果两个string对象的长度不同,而且较短的string对象的每个字符都与较长的string对象对应位置上的字符相同,就说较短的对象小于较长的对象。2如果两个string对象在某些对应的位置上不一致,则string对象比较的结果其实是string对象中第一对相异字符比较的结果。(1)#include<iostream>#include<stri...

2018-02-28 23:31:38 202

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除