调整权值

论坛 期权论坛 脚本     
匿名技术用户   2021-1-2 07:27   27   0
// try0422.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include "stdio.h"
#include "iostream"

//调整权重
void adjustWeight(int n ,double W[],double detW[])
{
 if(n<=0)
 {
  printf("参数出错");
  return;
 }
 for(int i=0;i<n;i++)
 {
  W[i]=W[i]+detW[i];
 }
}

int _tmain(int argc, _TCHAR* argv[])
{
 int n=3;
 double W[3]={1,2,3};
 double detW[3]={4,5,6};
 adjustWeight(n,W,detW);

 for(int i=0;i<n;i++)
 {
  printf("%f,  ",W[i]);
 }
 system("pause");
 return 0;
}


分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP