污染源确定的模型的程序实现

上传人:第*** 文档编号:34721968 上传时间:2018-02-27 格式:DOC 页数:2 大小:27.50KB
返回 下载 相关 举报
污染源确定的模型的程序实现_第1页
第1页 / 共2页
污染源确定的模型的程序实现_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《污染源确定的模型的程序实现》由会员分享,可在线阅读,更多相关《污染源确定的模型的程序实现(2页珍藏版)》请在金锄头文库上搜索。

1、#include #include #include #include #define NUM 36 #define CSTD 6.3 #define DSTD 5000 using namespace std; struct Dot int no; double x,y,z,c; dot200; FILE * f; int ct; double dis200200; void init() int i,tno; double tx,ty,tz,tc; f = fopen(“in.txt“,“r“); ct = 0; for(i=0;i=CSTD) dotct.no = tno; dotct.

2、x = tx; dotct.y = ty; dotct.z = tz; dotct.c= tc; ct+; double calDis(Dot a , Dot b) double dx,dy,dz,res; dx = a.x - b.x; dy = a.y - b.y;dz = a.z - b.z; res = sqrt(dx*dx+dy*dy+dz*dz); return res; void getDis() int i,j; for(i=0;ict;i+) for(j=0;jct;j+) if(i=j) disij = 0; else disij = calDis(doti,dotj); void select() int i,j; f = fopen(“out.txt“,“w“); for(i=0;ict;i+) for(j=0;jct;j+) if(disij=DSTD) fprintf(f,“%d %d %.4lfn“,doti.no,dotj.no,disij); int main() init(); getDis(); select(); return 0;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号