自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Ibelievesunshine的博客

热爱生活,寻找新鲜感

  • 博客(41)
  • 资源 (1)
  • 收藏
  • 关注

原创 解决office2016无法打开低版本office文件的问题 以word举例说明

win10系统下装了office2016在百度文库上下载了一个word文件,却无法打开,如图所示:查阅资料后找到了正确的处理方式:新建word文件,打开文件,点击文件右上角“文件”,再点击“选项”,再点击“信任中心”,再点击信任中心设置,再点击受保护的视图,将三个选项的勾选全部去掉即可。记得点击确定按钮保存设置。再次试图打开刚刚没有打开的文件,发现文件打开成功!...

2018-05-31 20:15:05 38137

原创 解决laravel框架中Eloquent ORM的save方法无法插入数据的问题

学习laravel中:今天在测试使用Eloquent ORM将数据使用 save()方法插入到mysql中时,出现了错误,如图所示:在网上查阅资料后找到了原因:使用save方法新增数据:laravel会默认维护 created_at , updated_at 两个字段,这两个字段都是存储时间戳,整型11位的,因此使用时需要在数据库添加这两个字段。如果不需要这个功能,只需要在模型里加一个属性:pub...

2018-05-25 12:37:16 9855

原创 最新解决laravel框架路由无法显示的问题

laravel版本为:    const VERSION = '5.2.45';今天开始学习传说中php非常好用的laravel框架,发现了系统的路由可以显示而我自己写的却不可以:http://localhost/laravel/public/basic      显示:找到apache的配置文件  搜索以下内容#LoadModule rewrite_module modules/mod_rewr...

2018-05-24 18:01:24 3866

原创 PHP基础学习课程强烈推荐

最近在复习PHP语言,在网上找了一些学习资料,发现百度传课刘海平老师讲解的PHP基础课程不错,内容详细,理论和实例相结合,通俗易懂,是网上免费学习PHP课程的不二之选。推荐给大家!!!链接: PHP基础学习课程在此感谢老师的课程讲解。...

2018-05-24 17:07:37 431

原创 PHP程序显示时出现乱码

久违的回顾一下php语言,却发现在浏览器显示时出现乱码:解决方式也很简单:在代码开头添加header("content-type:text/html;charset=utf-8");         //设置编码...

2018-05-18 17:42:20 1042

原创 C++ STL 文件内容的显示和追加

#include <iostream>#include <fstream>#include <string>#include <cstdlib>using namespace std;const string filename="F:/1.txt";int main(){ ifstream fin; fin.open...

2018-05-15 17:10:58 802

原创 C++ STL 一个简单的文件输入输出示例

//本程序实例简单介绍C++如何读写文件#include <iostream>#include <fstream>#include <string>using namespace std;int main(){ string filename; cout<<"Enter filename: "<<endl;...

2018-05-15 15:54:15 1695

原创 C++ STL 函数partial_sum的正确使用方法

partial_sum 对于序列 a,b,c,d 产生序列 a,a+b,a+b+c,a+b+c+d。//本程序实例演示partial_sum函数的正确使用方式#include <iostream>#include <vector>#include <algorithm>#include <numeric>using namespace st...

2018-05-14 12:24:34 10998

原创 C++ STL inner_product函数的使用方法

//演示inner_product的各种正确打开方式#include <iostream>#include <list>#include <numeric>#include <algorithm>using namespace std;//for_each中打印容器中的元素void print(int ele){ cout&l...

2018-05-14 11:51:39 4937

原创 C++ STL slice()函数的正确打开方式 带详细注释实例讲解

//本程序实例主要介绍了slice的正确玩法#include <iostream>#include <valarray>#include <cmath>using namespace std;void print(valarray<double> & v){ int size=v.size(); for(int i...

2018-05-13 18:08:00 6222

原创 C++ STL front_inserter back_inserter inserter 插入型迭代器的正确打开方式

#include <iostream>#include <deque>#include <algorithm>#include <iterator>using namespace std;int main(){ int dim[]={1,2,3,4,5,6}; deque<int> d1; copy(...

2018-05-12 23:05:29 391

原创 C++ STL 程序员必须会之学会删除容器中的元素 带详细注释实例版本

//本实例演示容器中各种删除操作的正确玩法//涉及remove erase remove_if remove_copy unique等函数#include <iostream>#include <vector>#include <iterator>#include <algorithm>#include <iterator>...

2018-05-12 17:54:37 233

原创 C++ STL 容器的合并、求差集、交集等操作实例 含详细注释版

//本实例程序演示容器之间合并、求差集、求交集//merge、inplace_merge、set_union、set_difference、set_intersection、#include <iostream>#include <list>#include <set>#include <algorithm>#include <it...

2018-05-12 16:16:28 3441

原创 C++ STL 堆(heap)的初始化及其正确使用

#include <iostream>#include <vector>#include <algorithm>#include <iterator>using namespace std;int main(){ vector<int> v1; double dim[]={1,2,3,4,5,6,8,7};...

2018-05-12 14:56:47 3087

原创 C++ STL 容器元素排列之next_permutation和prev_permutation的使用示范

//本程序示例演示next_permutation和prev_permutation#include <iostream>#include <vector>#include <deque>#include <algorithm>#include <iterator>using namespace std;int main(...

2018-05-10 17:30:43 429 1

原创 C++ STL 各种搜索查找算法总结使用

//本程序示例主要演示C++STL中各种搜索函数的使用#include <iostream>#include <vector>#include <algorithm>using namespace std;//模板函数,用于初始化容器的值template<class T> void FillValue(T& vect,int f...

2018-05-10 13:54:04 2793

原创 C++ STL min_element和max_element的使用方法

//本程序示范min_element和max_element的正确用法//既实现了无条件的最小值最大值求取,还实现了利用仿函数的最大值最小值的求取//本程序中仿函数的作用是利用元素绝对值进行比较#include <iostream>#include <algorithm>#include <vector>using namespace std;t...

2018-05-10 00:04:19 6504 1

原创 C++ STL priority_queue的正确使用方法

priority_queue相对于queue的不同之处在于:优先队列实现了内部自动排序,可根据自己需要自定义排序规则,可以自己编写函数或者仿函数用于内部优先级的确定。//priority_queue的正确使用方法#include <iostream>#include <queue>#include <vector>using namespace std;...

2018-05-09 22:50:22 5451

原创 C++ STL bitset类常用函数的使用

bitset创造一个内含位或布尔值且大小固定的数组(array)。当需要管理各种标识,并需要以标识的任意组合表现变量时,即可使用bitset模板类。接下来介绍基本函数的用法:count()     //统计1的个数any()        //判断位段中是否至少包含1个1none()     //判断位段中是否全部为0test()       //判断该位是1还是0set()        //设...

2018-05-09 19:48:00 1014

原创 C++ STL map和multimap的简单使用

#include <iostream>#include <map>using namespace std;typedef pair<int,double> CustomPair;void Print(map<int,double> & m){ map<int,double>::iterator it; ...

2018-05-09 11:12:11 789

原创 C++ STL list的成员函数splice的使用

#include <iostream>#include <list>#include <algorithm> //使用函数for_eachusing namespace std;void print(int& Ele){ //用于for_each中打印 cout<<Ele<<",";}int main..

2018-05-08 13:42:38 3244

原创 C++ STL 使用assign对list中的元素进行重置

//使用assign进行元素重置#include <iostream>#include <list>using namespace std;template<class T>void print(list<T>& mylist){    //必须显式使用typename告诉编译器list<T>::iterator是一个...

2018-05-07 11:25:35 2273 2

原创 C++ STL list容器中元素的存取和访问

list容器不提供 at() 和 操作符 operator[] ,对容器中元素的访问有些不便,但是我们可以使用迭代器进行元素的访问,例子如下:#include <iostream>#include <list>#include <algorithm>using namespace std;void print(double& Ele){ ...

2018-05-07 10:54:47 5486

原创 C++ STL vector容器的插入和删除

使用swap函数交换两个vector容器中的值#include <iostream>#include <vector>#include <algorithm>using namespace std;void OutToScreen(int& Ele){ cout<<Ele<<",";}int main()..

2018-05-06 18:13:11 2483

原创 C++ STL 容器vector元素排序实例

#include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;class student{public: student(const string& a,double b):name(a),score...

2018-05-06 15:07:24 460

原创 C++ STL vector容器元素的查找和搜索 find() find_if()函数的使用

#include <iostream>#include <vector>#include <algorithm>#include <functional>using namespace std;void print(const int& temp){ cout<<temp<<endl;}int...

2018-05-06 14:17:04 45764 1

原创 C++ STL 遍历vector

//遍历vector容器#include <iostream>#include <vector>using namespace std;struct ST{ int id; double db;};void Origin(int num,vector<ST>& vt){ int m=num; ST temp...

2018-05-06 12:38:02 390

原创 C++ STL vector size() capacity()函数

#pragma warning(disable:4786)#include <iostream>#include <string>#include <vector>using namespace std;int main(){ vector<string> myvt; myvt.push_back("1. BeiJing...

2018-05-06 12:10:17 646

原创 C++ STL valarray的赋值

#include <iostream>#include <valarray>using namespace std;template <typename T> void printValarray(const valarray<T>& va){ for(int i=0;i<va.size();++i){ ...

2018-05-05 20:18:34 945

原创 C++ STL 迭代器在string类中的使用方法

//以下例子说明迭代器在string类中的使用方法#include <iostream>#include <string>#include <algorithm>using namespace std;int main(){ string s("Hello World! I love programming!"); cout<...

2018-05-05 18:04:29 3797

原创 C++ STL getline函数

//getline()函数使用#include <iostream>#include <string>using namespace std;int main(){ string s1,s2; getline(cin,s1); getline(cin,s2,' '); cout<<"You inputed chars ...

2018-05-05 16:43:48 298

原创 C++ STL string字符串替换 replace函数的使用

//C++ string字符串替换//replace()函数的使用#include <iostream>#include <string>using namespace std;int main(){ string var("abcdefghijklmnopqrst"); const string dest("1234"); strin...

2018-05-05 16:32:33 7062

原创 C++ STL string字符串内容修改和替换

//字符串内容修改和替换#include <iostream>#include <string>using namespace std;int main(){    string str1("123456");    string str2("abcdefghijklmn");    string str;    //使用str1初始化str    s...

2018-05-05 16:11:29 6953

原创 C++ STL string类的compare函数使用

#include <iostream>#include <string>using namespace std;int main(){ string a("aBcdef"); string b("AbcdEf"); string c("123456"); string d("123dfg"); //下面是各种比较方法

2018-05-05 14:38:44 15229 4

原创 C++ STL string的构造函数

#include <iostream>#include <string>using namespace std;int main(){ string str("12345678"); char ch[]="abcdefghijklmn"; //定义空字符串a string a; //构造函数,将str全部复制给str_1;...

2018-05-05 14:19:29 771

原创 C++ STL 简单介绍<vector>的使用方法

#include &lt;iostream&gt;#include &lt;vector&gt;#include &lt;string&gt;using namespace std;const int NUM=5;int main(){ vector&lt;string&gt;names(NUM); vector&lt;int&gt;sexs(NUM); co...

2018-05-05 13:02:35 166

原创 C++ STL 一个简单的<stack>程序

#include &lt;iostream&gt;#include &lt;stack&gt;using namespace std;int main(){ stack&lt;int&gt; st; for(int i=0;i&lt;10;++i){ st.push(i); } while(!st.empty()){ cou...

2018-05-05 12:38:33 220

原创 C++ STL 字符串转其他类型 其他类型转字符串

#ifndef EX18_H_INCLUDED#define EX18_H_INCLUDED#include &lt;iostream&gt;#include &lt;string&gt;#include &lt;sstream&gt;//模板函数,将字符串转换成其他数据类型template &lt;class T&gt;T fromString(const std::string&a...

2018-05-04 23:13:13 529

原创 C++ STL 模板函数的使用

#include &lt;iostream&gt;#include &lt;string&gt;using namespace std;template &lt;class T&gt;void print(const T&amp; var){ cout&lt;&lt;var&lt;&lt;endl;}int main(){ string str("Hello Beiji...

2018-05-04 21:50:10 798

原创 C++ STL list 学习一

#include &lt;iostream&gt;#include &lt;list&gt;#include &lt;ctime&gt;using namespace std;void mysleep(int second){ clock_t st; st=clock(); while(clock()-st&lt;second*CLOCKS_PER_SEC); ...

2018-05-04 17:24:56 169

JAVA实现俄罗斯方块超详细视频教程及其源代码 看不懂视频你打我

该视频教程从零到一详细地讲解了如何利用JAVA语言实现俄罗斯方块游戏,讲解通俗易懂,是您学习了JAVA语言后开始学习JAVA项目的不二之选!哪里不懂可以通过博客联系我!

2018-04-25

空空如也

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

TA关注的人

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