问题描述
private:System::Voidbutton2_Click(System::Object^sender,System::EventArgs^e){inti,j,k=0;doublesumA=0,sumB=0,sumC=0,sumD=0,a,b,c,d,f;intsize;size=Convert::ToDouble(textBox1->Text);double*arrayM,*arrayX;arrayM=newdouble[size];double*arrayN;arrayN=newdouble[size];for(inti=0;i<dataGridView1.Rows.Count-1;i++){arrayN[i]=dataGridView1.Rows[i].Cells[0].Value;arrayM[i]=dataGridView1.Rows[i].Cells[1].Value;};for(i=0;i<size;i++){arrayX[i]=log(arrayM[i]);sumA+=arrayX[i];sumC+=arrayX[i]*arrayX[i];arrayY[j]=log(arrayN[j]);sumB+=arrayY[j];sumD+=arrayX[i]*arrayY[j];k+=1;d=sumA*sumB;f=(sumD-d/k)/(sumC-c/k);b=(sumB/k)-(f*sumB/k);a=pow(10,f);textBox2->Text=Convert::ToString(a);textBox3->Text=Convert::ToString(b);};
解决方案
解决方案二:
是不是控件不存在,有datagridview1么
解决方案三:
有的呀~有这个控件