很多人围成一圈,叫号,叫到某固定号出去。这里提供两种方法,希望可以理解。 摘要:#include<iostream>using namespace std;void fenxi(int n,int m){ int a[1000],s,num=0,i=0; for(i=0;i<…… 文章列表 2019年04月03日 1 点赞 0 评论 631 浏览 评分:0.0
利用递归函数寻找最大路径的方法,例题来自p1004 摘要:#include<iostream>#include<cstdio>using namespace std;int a[1001][1001],b[1001][1001];//a数组表示这个位置的高度…… 文章列表 2019年04月05日 0 点赞 0 评论 807 浏览 评分:0.0
getline() 与get()两个函数的异同 摘要:#include<iostream> #include<cstdio> #include<string> #include<vector> using namespace std; cons…… 文章列表 2019年04月11日 0 点赞 0 评论 792 浏览 评分:0.0
利用栈的思想写的队列 摘要: 队列是一种先进先出的线性结构。本文用栈的思想对队列重新定义,希望大家可以理解。 选取三个数据进行测试例:1 2 3 .#include<iostream> #include<cstdio> …… 文章列表 2019年04月14日 0 点赞 0 评论 796 浏览 评分:0.0
c++函数模板初 摘要:#include <iostream>#include <string>using namespace std;// 你提交的代码将嵌入到这里const int SIZE = 100;template…… 文章列表 2019年04月15日 0 点赞 0 评论 936 浏览 评分:0.0
数据结构之二叉树的递归遍历和非递归遍历 摘要:一、二叉树在计算机科学中,树是一种重要的非线性数据结构,直观地看,它是数据元素(在树中称为结点)按分支关系组织起来的结构。二叉树是每个节点最多有两个子树的有序树。通常子树被称作“左子树”(left s…… 文章列表 2019年04月16日 2 点赞 0 评论 838 浏览 评分:0.0
回溯法求背包问题 摘要:#include<iostream> #define N 3 //物品总数 #define C 16//背包总质量 using namespace std; int w[N]={10,8,5}…… 文章列表 2019年04月20日 1 点赞 0 评论 742 浏览 评分:0.0
回溯法求旅行售货员问题 摘要:#include<iostream> using namespace std; const int INF = 10000000; int n, cc = 0, bestc = INF;//n表…… 文章列表 2019年04月20日 0 点赞 0 评论 1130 浏览 评分:0.0
数据结构之图的创建(邻接表法) 摘要:#include<iostream> #include<cstdio> #include<cstdlib> using namespace std; #define ok 1 #define…… 文章列表 2019年04月22日 0 点赞 0 评论 873 浏览 评分:0.0