易截截图软件、单文件、免安装、纯绿色、仅160KB

帮忙把下面个c函数转成c#的

const int num=100
float neiji(float [num]b, float [num]c)
        {
            int p;
            float nj = 0;
            for (p = 1; p < num; p++) nj += c[p] * b[p];
            return nj;

        }

C# code:

const int num=100
public float neiji(float[] b, float[] c)
{
float nj = 0;
for (int p = 1; p < b.Length; p++) nj += c[p] * b[p];
return nj;

}




引用
C# codeconstint num=100publicfloat neiji(float[] b,float[] c)
        {float nj=0;for (int p=1; p < b.Length; p++) nj+= c[p]* b[p];return nj;

        }


呃,这样的话b.length是不是等于100哟?

const int num=100;
        private float neiji( float []b, float []c)
        {
            int p;
            float nj = 0;
            for (p = 1; p < num; p++)
      &nbs


相关问答:

C文件读写

char data[255]={0},user[15],password[32];

if((fp=fopen("QQ.ini","wb+"))==NULL)
{
printf("无法创建QQ.ini文件\n");
system("pause");
exit(0); ......

c signal调用问题

开始学OS,按练习要求写的代码在gcc下无法编译:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>

void SIGFPEhandler2(int s ......

extern "C"问题

/*-----------c.h--------------*/
#ifndef _C_H_
#define _C_H_
extern "C" int add(int x, int y);
#endif

/*-----------c.c--------------*/
int add(int x, int y){
return ......

关于字符串的C面试题

给一个字符串、例如 “ababc”要求返回“ab”. 因为“ab”连续重复出现且最长。  用C/C++语言写一函数完成该算法,给出复杂度
这个题我不会

C/C++ code:

#include <iostream>
#include <s ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号