![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
爱进步 C++程序
文章平均质量分 65
iSuwen
这个作者很懒,什么都没留下…
展开
-
c++文件流中文件路径
1.1 小议c++文件流中文件路径 在论坛中闲逛时,经常发现有朋友调试c/c++文件流的代码时,遇到文件路径的问题。下来我结合自己的经验,一起探讨一下。1.1.1 文件路径的基本概念OS的文件系统是一个树状结构,有目录、文件的概念。windows系统的例子:E:/myprograme/BBG/include/bbg_stl>tree E:.│ bb转载 2012-06-15 14:22:39 · 1684 阅读 · 0 评论 -
水文分析与计算——年均流量趋势检验(Mann-Kendall法、线性回归法)
//年均流量趋势检验.h//年均流量Mann-Kendall法趋势分析void MannKendall(){ using namespace std; int S = 0;//检验的统计变量 double VarS,//统计变量S的方差 Z ;//标准正态统计变量方差 S = 0; for(int i = 0; i < Y; i++) for(int j = i + 1;原创 2012-06-25 10:39:55 · 14639 阅读 · 1 评论 -
水利水能规划—水电站水库特征参数选择——正文
原创 2012-07-11 22:01:14 · 2532 阅读 · 0 评论 -
水利水能规划—水电站水库特征参数选择——附表及附图
原创 2012-07-11 22:14:05 · 3052 阅读 · 0 评论 -
水利水能规划—水电站水库特征参数选择——C++程序
// 水利水能规划课设项目.cpp #include "stdafx.h"#include #include #include #include const int NumSeries = 20;//泄洪插值系列原始值数目double ZSeries[NumSeries], VSeries[NumSeries], qSeries[NumSeries];//插值原始系列值doub原创 2012-07-11 22:20:04 · 3423 阅读 · 0 评论 -
水利水能规划——兴利调节模拟计算法
//兴利调节模拟计算.cpp//通过额定供水量(此程序中为固定值)求有效库容//或通过有效库容求额定供水量(求得结果为定值)//来水过程已知,从已经划分好水利年的入库流量读取//用水保证率已知#include "stdafx.h"#include #include#includeint T;//系列资料长度,单位:年int DestroyYear, DestroyMonth;原创 2012-06-25 10:30:31 · 3535 阅读 · 0 评论 -
水文分析与计算——频率分析及洪水流量过程
//频率分析.hvoid PinLvFenXi(){ using namespace std; const int NYear = EndYear - 1862 + 1,//调查考证期(1862-2000) L = 1,//实测期特大洪水个数 a = 2,//考证期及实测期特大洪水个数 YearSuperYearW[a] = {1903, 1975},//特大洪水年份 Su原创 2012-06-25 10:42:38 · 6666 阅读 · 1 评论 -
动态规划——最小投资 小程序
求A到E最小投资:#include "stdafx.h"#include #include #include using namespace std;void main (){ char Str[5] = {'E', 'D', 'C', 'B', 'A'}; double d[4][7] = {{3, 8, 7}, {4, 2, 3, 8, 7,原创 2012-06-03 23:28:40 · 1290 阅读 · 0 评论 -
中长期水文预报——周期叠加法
输入文件://input.txt(年最高水位)8.71 7.95 8.31 9.43 7.27 6.44 7.57 8.04 6.86 8.30 9.06 7.37 7.30 8.09 7.69 7.36 7.50 8.11 7.59 7.84 6.33 8.78 //F0.05.txt(F0.05分布表)161.4 199.5 215.7 224原创 2012-06-03 23:51:22 · 2163 阅读 · 0 评论 -
中长期水文预报——逐步回归法
原始数据:年份x1x2x3x4预报对象y195526.429.14.15.83467195627.628.812.3626221957原创 2012-06-03 23:58:29 · 1987 阅读 · 1 评论 -
中长期水文预报——逐段回归法
原始数据:年份x1x2x3x4预报对象y195526.429.14.15.83467195627.628.812.3626221957原创 2012-06-04 00:01:42 · 1601 阅读 · 0 评论 -
艾学山老师 VC随机抽题
原创 2012-06-04 00:13:37 · 2050 阅读 · 0 评论 -
正态分布累积函数及其反函数 C/C++
/////////////////////////////////////////////////////////////////////////////////////////利用梯形法生成符合标准正态分布的累积函from Dain////////////////////////////////////////////////////////////////////////////////原创 2012-06-25 10:47:21 · 18322 阅读 · 5 评论 -
水文分析与计算——主函数
//主函数//水文分析与计算课设项目.cpp#include "stdafx.h"#include #include #include #include const int StartYear = 1956,//起始年月日 EndYear = 2000,//结束年月日 Y = EndYear - StartYear + 1,//年序列数 J = 4,//4种年极值情原创 2012-06-25 10:35:35 · 1876 阅读 · 0 评论 -
水文分析与计算——代表性分析(滑动平均法)
//代表性分析.h//滑动平均值法const int M =4,// NumM[M] = {3, 5, 7, 9};//NumM[i]年滑动平均法double HPMaxYearW;void DaiBiaoFenXi(){ using namespace std; ofstream outfile; outfile.open("outfile_YearW_HP.txt");原创 2012-06-25 10:40:53 · 4439 阅读 · 0 评论 -
基于遗传算法的新安江模型参数优化率定(二)
2流域水文预报模型2.1 流域产流方案模型的选定:竹溪坡流域属东亚季风副热带暖湿气候区,湿润多雨, 多年平均年雨量为1400mm~1800mm, 年内降雨量主要集中在4~8月,一次洪水历时可达7~8天。流域内植被良好,符合蓄满产流模型的应用条件。 蒸发的计算:流域蒸发采用三层蒸发模式,蒸发资料采用附近柘溪站E601型蒸发器实测值,以1980~1988年9年资料进行统计,分别求原创 2012-06-16 19:01:40 · 8653 阅读 · 2 评论 -
基于遗传算法的新安江模型参数优化率定(三)
原创 2012-06-16 19:17:05 · 3313 阅读 · 0 评论 -
基于遗传算法的新安江模型参数优化率定(四)
4.3 C++程序代码4.3.1 新安江三水源模型//新安江三水源模型.h#include #include #include #include const intVariableNum = 11, //待率定参数个数 M = 485,//其为降雨起止间时段数(应该为) Mq = 14;//单位线中q原创 2012-06-16 19:18:49 · 6046 阅读 · 1 评论 -
基于遗传算法的新安江模型参数优化率定(一)
1参数率定选用的流域1.1流域概况竹溪坡流域慨况及暴雨洪水一般特性:竹溪坡流域位于湖南资水支流伊溪的上游,集水面积686km2,属山区,河长49km,干流坡降2.42‰。流域内有三个雨量站,即竹溪坡、梅城、黄柏界,流域出口设有竹溪坡水文站,具有较长期的实测雨量、流量资料。流域概况见图1。该流域属东亚季风副热带暖湿气候,夏季炎热多雨,冬季寒冷干燥。该流域是湖南省著明的暴雨高值区,原创 2012-06-16 18:51:39 · 6712 阅读 · 0 评论 -
希腊字母表
序号 大写 小写 英文注音 国际音标注音 中文读音 意义1 Α α alpha a:lf 阿尔法 角度;系数2 Β β beta bet 贝塔 磁通系数;角度;系数3 Γ γ gamma ga:m 伽马 电导系数(小写)4 Δ δ delta delt 德尔塔 变动;密度;屈光度5 Ε ε epsilon ep`silon 伊普西龙 对数之基数6 Ζ ζ zeta zat原创 2012-06-25 10:52:27 · 4519 阅读 · 0 评论 -
水文分析与计算——缺失流量线性插值及相关分析
//相关分析.hvoid XiangGuanFenXi(){ using namespace std; const int M = 6209;//倚用系列长度 const int Cha = 4380;//待插补系列长度 double H[M] = {0},//水位 Q[M] = {0},//流量 AverageH = 0, AverageQ = 0,//均值 a,原创 2012-06-25 10:36:54 · 2685 阅读 · 0 评论 -
水文预报——竹溪坡流域洪水预报
// 竹溪坡流域水文预报C++程序//本流域中,不同次洪需要修改M值,其为次洪降雨起止间时段数//本流域中,不同次洪需要在"infile_P_Ep.txt"文件中修改为对应的数据//若单位线需要调整,在"infile_q.txt"文件中修改#include "stdafx.h"#include #include #include #include using namespac原创 2012-06-04 00:17:58 · 3421 阅读 · 0 评论 -
水环境学——利用最小二乘法对BOD降解好氧系数K1估算
由BOD的实验室化验资料估算讲解系数K1时,可以采用最小二乘法。//"input.txt"BOD化验资料t(d) y(mg/L)1 552 813 1024 1195 1316 1407 1478 1539 15910 162#include "stdafx.h"#include #include #include void main(){ usin原创 2012-06-06 22:04:02 · 1727 阅读 · 0 评论 -
水环境学——显式差分 计算均匀河段各断面BOD变化
#include "stdafx.h"#include #include #include #include void main(){ using namespace std; const int Nx = 8, //等于x/dx Nt = 10;//等于t/dt const double dx = 1.0, dt = 0.1, //要保证dt<=dx/u,E*dt原创 2012-06-06 22:15:02 · 1928 阅读 · 1 评论 -
双点弦截法迭代程序
// 双点弦截法迭代#include "stdafx.h"#include #include #include double fx(double x){ double f = log(x) +2.0/9/(x - 1) - 4.697;//注意用2.0/9, 而不是2/9 return f; //f(x) = 0中的f(x)函数形式}void main(){ using原创 2012-06-07 15:38:09 · 4399 阅读 · 0 评论 -
水文分析与计算——年均流量及年极值洪量
//年均流量及年极值洪量.hvoid NianJunZhi(){ using namespace std; ofstream outfile; outfile.open("outfile_YearQ_W.txt"); outfile<<setw(10)<<"年份"<<setw(10)<<"天数"<<setw(10)<<"年均流量"; for(int k = 0; k < J; k++原创 2012-06-25 10:38:23 · 2726 阅读 · 0 评论 -
F分布的C/C++代码
#include#include#includedouble FDist(double F,double m,double n);double betainv(double p,double a,double b);double betainc(double x,double a, double b);double beta(double z,double w);double ga原创 2013-05-14 18:13:41 · 3062 阅读 · 1 评论