解决方案
5
调用你的方法执行
5
Complex 代码是什么
85
class Complex
{
public static implict operator Complex(string text)
{
string[] x = text.Split("+");
double real = double.Parse(x[0]);
double imaginary = double.Parse(x[1].TrimEnd("i"));
return new Complex(real, imaginary);
}
}
5
textBox1.text 的值是 string ,不能直接给 Complex 类赋值,要把 textBox 里面的 string 转换成 int 然后给Complex对象