自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 字符串匹配问题

Brute Force算法比较简单好理解#include <iostream>int match(char *s, char *t);int main(){ char str_s[7] = "aaaaab"; char str_t[5] = "aaab"; int result = match(str_s, str_t); if(result >= 0...

2019-06-22 16:20:31 820

原创 环形队列 报数问题

#ifndef queue_h#define queue_h#include <iostream>const int Queue_Maxsize = 10;class queue{ private: int front; int rear; int data[Queue_Maxsize]; public: queue() { front = ...

2019-06-20 21:14:36 1445

原创 迷宫问题 链队解法

//queue.h#ifndef queue_h#define queue_h#include <stdlib.h>#include <iostream>struct point{public: int index; int x; int y; int pre;};struct queue{private: struct Node {...

2019-06-19 21:42:39 393

原创 迷宫问题 栈解法

//// stack.h// #ifndef stack_h#define stack_h static const int Size = 50;struct point{public: int x; int y; int dir;}; struct stack{private:public: point data[Size]; int top; ...

2019-06-18 22:27:47 428

原创 四则混合运算

//// calculate.cpp//#include "calculate.hpp"const int MaxSize = 50;int main(){ char exp[] = "(56-20)/(4+2)"; char postexp[MaxSize]; trans(exp, postexp); printf("中缀表达式:%s\n", ...

2019-06-16 19:04:03 1434

原创 剑指刷题 面试题3、4

面试题3P39#include <iostream>#include <vector>int find_re(std::vector<int> v);int main(){ using namespace std; int temp; vector<int> vct; cout << "Enter numbe...

2019-06-11 13:14:14 96

原创 C++ Primer Plus 第六版第十七章编程练习答案

//question1#include <iostream>#include "string.h" const int LIMIT = 255;int main(){ char input[LIMIT]; char t; int count = 0; std::cout << "Enter a phase: \n"; std::cin.get(in...

2019-06-06 23:13:26 1036

原创 C++ Primer Plus 第六版 第十六章编程练习答案

//question1#include <iostream>#include <string>bool is_circle(const std::string & s);int main() { std::string s; std::cout << "Enter a word(q to quit): \n...

2019-05-26 10:39:50 706 2

原创 C++ Primer Plus 第六版第十五章编程练习答案

//question1//tv.h#ifndef TV_H#define TV_Hclass Remote;class Tv{ private: int state; int volume; int maxchannel; int channel; int mode; int i...

2019-05-18 23:00:19 866

原创 C++ Primer Plus 第六版第十四章编程练习答案

//question 1//wine.h#ifndef WINE_H#define WINE_H#include <string>#include <valarray>template <class T1, class T2>class Pair{ private: T1 a; T2 b; pu...

2019-03-30 22:06:01 731

原创 C++ Primer Plus 第六版第十三章编程练习答案

//question1//classic.h#ifndef CLASSIC_H#define CLASSIC_Hclass Cd{ private: char performers[50]; char label[20]; int selections; double playtime; public:...

2019-03-25 22:48:30 342

原创 C++ Primer Plus 第六版第十二章编程练习答案

//question1//Cow.h#ifndef COW_H#define COW_Hclass Cow{ char name[20]; char * hobby; double weight; public: Cow(); Cow(const char * nm, const char...

2019-03-21 21:57:56 663

原创 C++ Primer Plus 第六版第十一章编程练习答案

//question1//vector.h#ifndef VECTOR_H#define VECTOR_H#include &lt;iostream&gt;namespace VECTOR{ class Vector { public: enum Mode {RECT, POL}; private: ...

2019-03-17 16:01:25 506

原创 C++ Primer Plus 第六版第十章编程练习答案

//question1//bank.h#ifndef BANK_H#define BANK_H#include &lt;iostream&gt;#include &lt;string&gt;class Bank{ private: std::string name; std::string account; doubl...

2019-02-27 22:26:06 406

原创 C++ Primer Plus 第六版第九章编程练习答案

//question1// golf.h#ifndef GOLF_H#define GOLF_Hconst int Len = 40;struct golf{    char fullname[Len];    int handicap;};void setgolf(golf &amp; g, const char * name, int hc);int setgol...

2019-02-24 20:38:05 552

原创 C++ Primer Plus 第六版第八章编程练习答案

#include &lt;iostream&gt;#include &lt;cstring&gt;#include &lt;cctype&gt;using namespace std;void q1();void print(char * a, int b = 0);const int Len = 40;struct CandyBar{    char maker[Len]...

2019-02-22 20:54:14 720

原创 C++ Primer Plus 第六版 第七章编程练习答案

#include &lt;iostream&gt;#include &lt;cstring&gt;double q1(double a, double b);void q2();int enter(double * arr, int size);void show(double arr [], int size);double mean(double * arr, int size)...

2019-02-18 10:19:33 727

原创 C++ Primer Plus 第六版编程练习第六章答案

#include &lt;iostream&gt;#include &lt;cctype&gt;#include &lt;string&gt;#include &lt;fstream&gt;#include &lt;cstdlib&gt;using namespace std;void question_1();void question_2();void question_...

2019-02-15 10:47:59 412

原创 C++ Primer Plus 第六版 第五章编程练习答案

欢迎纠错讨论啦~ #include &lt;iostream&gt;#include &lt;vector&gt;#include &lt;cstring&gt;#include &lt;string&gt;using namespace std;void question_1();void question_2();void question_3();void que...

2019-02-12 20:55:07 418

原创 C++ Primer Plus 第六版编程练习 第四章答案

欢迎讨论纠错~ #include &lt;iostream&gt;#include &lt;cstring&gt;#include &lt;string&gt;#include &lt;vector&gt;using namespace std;void question_1();void question_2();void question_3();void ques...

2019-02-10 17:07:37 543

原创 C++ Primer Plus 第六版 第三章编程练习答案

自己写的 欢迎探讨纠错呀#include &lt;iostream&gt;using namespace std; void question_1();void question_2();void question_3();void question_4(); void question_5();void question_6();void question_7();in...

2019-02-01 18:07:30 261

原创 C++ Primer Plus第六版编程练习第二章

最近开始刷书 希望别半途而废吧第二章编程练习本人的答案如下,欢迎讨论纠错#include &lt;iostream&gt;using namespace std;void question1();void question2();void question3_1();void question3_2();void question4();void question5();...

2019-01-28 10:23:06 207

原创 python读网页数据绘图

看python基础教程的项目觉得还挺有意思没有看书上的例程自己写的一个代码 跑通了来写两笔感觉还有点复杂 先是读网页上的txt文件之后按行读取为列表然后将不是以数字开头的行删除分别将几列存为列表并将字符串列表转换为浮点型数字列表最后绘图并加legend参考了众多帖子最后写出来为import urllib2import numpy as npimport

2017-05-22 20:13:24 1594

转载 python安装pip

pip是用来方便地管理Python的第三方包的,由于此前玩Python仅仅是浅尝辄止,用的是python(x,y),但是这里并不代表你想用什么包都能从里面找到的,所以我把python(x,y)卸了,然后重新装了个Python2.7.5,准备尝试一下用pip来下载想要的包。不过pip也有一个麻烦之处,如果电脑不能联网怎么办?之后再考虑这个问题,先在此记录一下我是如何安装pip的。本文

2017-05-21 15:20:38 533

转载 python sqlite3 数据库学习

Python SQLITE数据库是一款非常小巧的嵌入式开源数据库软件,也就是说没有独立的维护进程,所有的维护都来自于程序本身。它使用一个文件存储整个数据库,操作十分方便。它的最大优点是使用方便,功能相比于其它大型数据库来说,确实有些差距。但是性能表现上,SQLITE并不逊色。麻雀虽小,五脏俱全, sqlite 实现了多数 sql-92 的标准,比如说 transaction 、 trigger

2017-05-18 19:47:14 410

转载 MATLAB中绘制椭圆

主要参考http://www.ilovematlab.cn/thread-68728-1-1.html添加一部分自己的体会一、根据椭圆方程:ax*x+bx*y+c*y*y+d*x+e*y = f画椭圆【例1】已知椭圆方程:x*x + 2*x*y + 3*y*y + 4*x + 5*y = 6第一种方法:调用MATLAB自带的ezplot函数画椭圆 >>

2017-05-02 14:35:08 74076 9

原创 matlab生成图片清晰插入论文

一般在MATLAB中生成的仿真结果图会存为fig格式,便于再次打开处理可以reuse但在写论文时往往需要插入MATLAB生成的图作为例证之前我习惯于直接saveas保存为jpg格式,再在word中插入jpg图片但jpg图片经过压缩很不清楚 曲线毛躁,看起来不规范,文件大小为24kb,效果是这样:又试了bmp格式 还是不清楚不满意 它比jpg好一些,文件大小是692kb,效果

2017-04-01 10:44:23 28182

原创 python 2与3区别小记

两台电脑 一台安装的是python2 另一台安装的是python3 刚开始学习 遇到一些小问题打算记一下昨晚学到异常的时候在python2中写了一段没有报错while True:    try:        x=input('please enter the first number: ')        y=input('please enter the second nu

2017-03-30 16:07:42 373

空空如也

空空如也

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

TA关注的人

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