1、2
public class Complex()
{
   private int read;
   private int imaginary;
 
   publci Complex()
   {
       read=1;
       imaginary=1;
   } 
   publci Complex(int iRead,int iImage)
   {
       read=iRead;
       imaginary=iImage;
   } 
  
}

解决方案 »

  1.   

    谢谢你的回复哟public class Complex()中好像不该有()吧还有就是你把public 打成publci啦
    剩下的还有吗
      

  2.   

    本示例展示如何使用运算符重载创建定义复数加法的复数类 Complex。本程序使用 ToString 方法的重载显示数字的虚部和实部以及加法结果。
    // complex.cs
    using System;public struct Complex 
    {
       public int real;
       public int imaginary;   public Complex(int real, int imaginary) 
       {
          this.real = real;
          this.imaginary = imaginary;
       }   // Declare which operator to overload (+), the types 
       // that can be added (two Complex objects), and the 
       // return type (Complex):
       public static Complex operator +(Complex c1, Complex c2) 
       {
          return new Complex(c1.real + c2.real, c1.imaginary + c2.imaginary);
       }
       // Override the ToString method to display an complex number in the suitable format:
       public override string ToString()
       {
          return(String.Format("{0} + {1}i", real, imaginary));
       }   public static void Main() 
       {
          Complex num1 = new Complex(2,3);
          Complex num2 = new Complex(3,4);      // Add two Complex objects (num1 and num2) through the
          // overloaded plus operator:
          Complex sum = num1 + num2;     // Print the numbers and the sum using the overriden ToString method:
          Console.WriteLine("First complex number:  {0}",num1);
          Console.WriteLine("Second complex number: {0}",num2);
          Console.WriteLine("The sum of the two numbers: {0}",sum);
     
       }
    }
      

  3.   

    以上的这个例子。我也SEE 过不过和那题的要求好像不符哟
    不过不是要谢谢你们的回复都怪本机没有VS。NET只好辛苦你们啦
      

  4.   

    因为本机上没有VS。NET无法调试你可否把整个程序调试后再贴一个上来呀谢谢啦
      

  5.   

    brightheroes(闭关|那一剑的风情)写的很详细了,你可以不装VS.NET,只要安装.net framework就可以了。