String ^ name;
Double^ math;
Double ^ physics;
Double ^ english;
Double ^ chemistry;
Double ^ cs;
Double ^ avrg;
Double ^ grade;
name = this->name->Text;
math = Convert::ToDouble(this->textmath->Text);
physics = Convert::ToDouble(this->phis->Text);
english = Convert::ToDouble(this->eng->Text);
chemistry = Convert::ToDouble(this->chem->Text);
cs = Convert::ToDouble(this->cstf->Text);
Double^ sum = (math + physics + english + chemistry + cs) / 5;
在Double ^ sum的最后一次操作中出现错误:
1智能感知:无操作员" +"匹配这些操作数
操作数类型是:System :: Double ^ + System :: Double ^
你能帮我找个答案吗?谢谢!
答案 0 :(得分:1)
不要使用物品!
String ^ name = this->name->Text;
Double math = Convert::ToDouble(this->textmath->Text);
Double physics = Convert::ToDouble(this->phis->Text);
Double english = Convert::ToDouble(this->eng->Text);
Double chemistry = Convert::ToDouble(this->chem->Text);
Double cs = Convert::ToDouble(this->cstf->Text);
Double sum = (math + physics + english + chemistry + cs) / 5.0;