搜索资源列表
neipaixu
- [问题描述] 将N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前,要求使用最少的附加空间,且算法的时间复杂度为O(N) [输入] 待排序记录个数,各关键字的值。 [输出] 关键字从正负分开,正数在前 [存储结构] 待排序记录顺序存储。 [算法的基本思想] 快速排序算法每次任取一个记录的关键字为标准,将其余记录分为两组将,N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前。 #in
c++第2章习题答案
- . 求一元二次方程式ax2+bx+c=0的实根,如果方程没有实根,则输出有关警告信息。 2. 将例8.3程序改为下面的程序,请分析执行过程,写出运行结果。并指出由于异常处理而调用了哪些析构函数。#include <iostream.h> 于面向对象的程序设计,是一种功能强大的混合型的程序设计语言
jiayouwenti
- 用贪心算法实现加油问题的代码,而且是以C++实现的。-this is a C++!include<iostream.h> #include<fstream.h> ifstream infile("E:\\jiayou.in") ofstream outfile("E:\\jiaou.out") void jiayou(int*x,int n,int k){
BP
- BP神经网络程序,C语言源代码 如下: #include "iostream.h" #include "iomanip.h" #include "stdlib.h" #include "math.h" #include "stdio.h" #include "time.h" #include "fstream.h" #define N 120 //学习样本个数 #define IN 3 //输入层神经元数目 #define HN 2 //隐层神经元数目
bp
- #include "iostream.h" #include "iomanip.h" #define N 20 //学习样本个数 #define IN 1 //输入层神经元数目 #define HN 8 //隐层神经元数目 #define ON 1 //输出层神经元数目 double P[IN] //单个样本输入数据 double T[ON] //单个样本教师数据 double W[HN][IN] //输入层至隐层权值 double V[ON][HN] //隐
fenzhi
- #include <iostream.h> int main() { int i(0),sum(0) while (i<=100) { sum=sum+i ++i }cout<<"sum="<<sum<<endl return 0; } -#include <iostream.h> int main() { int i(0),sum(0)
Lave1
- #include <iostream> #include <stdlib.h> #include <string.h> using namespace std const kl = 4, kzs = 2, m = 6, n = 4, Error = 5 char *K[kl] = {{"01"},{"bB"},{"23456789ACDEFacdef"},{"hH"}} int A[m][n] = {{1,2,2
Laba_0
- #include "comparer.h" #include <iostream> using namespace std int Comparer::compareByName(Student& s1,Student& s2) { return strcmp(s1.m_szName,s2.m_szName) } int Comparer::compareBySurname(Student& s1,Student& s2) { ret
SHORTEST
- 弗洛伊德求最短路径的VC算法 #include <iostream> using namespace std #define MAXV 50 #define INF 32767 typedef int InfoType //邻接矩阵存储方法 typedef struct { -Freud find the shortest path algorithm# include VC <iostream> using namespace s
huangjin
- 一维搜索的黄金分割C++算法,内附图片以供参考-#include "stdafx.h" #include<iostream> using namespace std
zuixiao
- 最小重量机器设计问题,回溯法和分支限定法-#include<iostream> using namespace std #define N 3 #define M 3 int w[N][M]={{1,2,3},{3,2,1},{2,2,2}} int c[N][M]={{1,2,3},{3,2,1},{2,2,2}} class machine {public:
juzhen
- 矩阵操作 c++实现 课程设计 #include <iostream.h> #include <stdlib.h> #include<iomanip.h> void fanzhuan1(int b[5][5]) void fanzhuan2(int b[5][5]) void juandong1(int b[5][5]) void juandong2(int b[5][5]) void print(int b[5]
iostream
- 在C++环境下,类的成员函数作为友元函数的实际例子 -In C++ environment, the class member function as a practical example of a friend function
new
- 二维坐标系上有一些炸弹,每个炸弹有x,y坐标和爆炸后波及的范围r,这个r指的是跟自己曼哈顿距离r以内的点 就类似于扫雷那样,一个炸弹爆炸可能引起一片一片的炸弹炸出去 然后有一些询问,问点燃某个炸弹后会有多少个炸弹爆炸 已经炸过的就不算了 -#include <iostream> #include <vector> #include <algorithm> #include <cstdio>
001
- 计算矩形的面积和周长、面向对象程序设计 #include<iostream> #include"002.h" using namespace std int main() { double x1,y1,x2,y2 cout<<"请分别输入左下右上点的坐标,用空格分开"<<endl cin>>x1>>y1>>x2>>y2 juxing j1(x1,y1,x2,y2
MiGong
- 1. 问题描述: 本实验假设迷宫是一个n 行n列的二维平面表格,左上角作为迷宫的入口,右下角作为迷宫的出口。迷宫问题求解的目标是寻找一条从入口到出口的通路。 2.基本要求: 设计一个程序,能自动或手动生成这样一个n行n列的矩阵maze[n][n],即每个元素都为0或1的二维数组,然后判断该矩阵表示的迷宫是否存在一条从入口到出口的通路。如果存在,将表示该通路的数组下标按顺序保存到文件path.txt如:(1,1)(2,2)(1,3)(1,4)(1,5)(1,6)(2,6)(3,6)(4
Euclidean-division
- 辗转相除法递归求最大公约数 #include iostream using namespace std -Euclidean division method recursively find the greatest common divisor
HASH
- HASH函数实现//输入输出采用直接在对话框进行的方式 //雪崩测试的改变位数由伪随机数生成 #include<iostream> #include<string.h> #include<stdio.h> #include<conio.h> #include<time.h> using namespace std -hash function