自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

ricexx的博客

编程小白记录成长过程

  • 博客(12)
  • 收藏
  • 关注

原创 全排列的递归做法

全排列采用string递归的做法q:对123进行排列输出所有可能#include<iostream>#include<string>using namespace std;void pailie(string a,int k)//k为当前位置{ if(k==(int)a.length()) { cout<<a; cout<<e...

2019-02-21 15:46:26 201

原创 蓝桥喷水装置

//蓝桥喷水装置#include<iostream>#include<cmath>using namespace std;double g(double a){ return sqrt(a*a - 1.0);}int main(){ int m, n,p,q; q = 0; cin >> m; p = m; double sum = ...

2019-01-04 22:01:43 161

原创 蓝桥特殊回文数问题

特殊回文数问题描述  123321是一个非常特殊的数,它从左边读和从右边读是一样的。  输入一个正整数n, 编程求所有这样的五位和六位十进制数,满足各位数字之和等于n 。输入格式  输入一行,包含一个正整数n。输出格式  按从小到大的顺序输出满足条件的整数,每个整数占一行。样例输入52样例输出899998989989998899数据规模和约定  1<=n<...

2019-01-04 22:01:04 151

原创 图的邻接矩阵表示c++

#include<iostream>#include<queue>using namespace std;enum graphtype { undigraph, digraph, undinetwork, dinetwork };//枚举template<class T>struct edgetype{ T head, tail; int cos...

2018-12-29 14:39:17 655 1

原创 蓝桥竞赛题 蚂蚁感冒

标题:蚂蚁感冒长100厘米的细长直杆子上有n只蚂蚁。它们的头有的朝左,有的朝右。每只蚂蚁都只能沿着杆子向前爬,速度是1厘米/秒。当两只蚂蚁碰面时,它们会同时掉头往相反的方向爬行。这些蚂蚁中,有1只蚂蚁感冒了。并且在和其它蚂蚁碰面时,会把感冒传染给碰到的蚂蚁。请你计算,当所有蚂蚁都爬离杆子时,有多少只蚂蚁患上了感冒?【数据格式】第一行输入一个整数n (1 < n < 50)...

2018-12-28 21:21:26 136

原创 回文数c++

//回文数#include<iostream>#include<string>using namespace std;template<class T>struct Node{ T data; Node<T> *next;};template<class T>class

2018-12-28 09:45:33 776

原创 哈夫曼树c++

#include<iostream>#include<iomanip>#include<stack>using namespace std;struct element{ int weight; int lchild, rchild, parent;};class HTree{ element *node; int n, m; stac...

2018-12-28 09:44:08 1202

原创 二叉树及操作c++

//二叉树及操作#include<iostream>#include<cstring>using namespace std;template<class T>struct Node1//栈和队列共用结构{ T data; Node1<T> *next;};//栈和队列其实都可以直接调用。//栈定义template<cl...

2018-12-28 09:35:49 206

原创 链队列的c++实现

//链队列#include<iostream>using namespace std;struct Node{ int data; Node *next;};class linkque{ Node *front, *rear;//队头指针,队尾指针public: linkque(); ~linkque(); void enque(int x);//入队 i...

2018-12-28 08:44:56 1938 1

原创 多项式的储存与运算c++

#include<iostream>using namespace std;template<class T>struct Node{ float coef;//系数 int exp;//指数 Node<T> *next;//指针};template<class T>class Linklist{ Node<T> ...

2018-12-27 20:51:22 1061

原创 单链表的c++实现

单链表的c++实现#include<iostream>using namespace std;template <class T>struct Node //结点定义{ T data; Node<T> *ne

2018-12-27 20:44:10 1871 2

原创 约瑟夫环的c++实现

//约瑟夫环#include<iostream>using namespace std;template<class T>struct Node //结点结构{ T data; //结点数据 Node<T> *next;};template<class T>class linklist//循环链表{ Node<T...

2018-12-27 20:42:01 2524

空空如也

空空如也

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

TA关注的人

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