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;
}
}
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;
}
}
解决方案 »
- C#循环嵌套的优化,坐等!急急急!!!
- 请问c#中mobile程序怎样连接服务器上的sql server数据库?
- 求c#考题,要二级考试了可怜一套完整的题都没有,那位高手来帮一下,谢谢
- 关于c#中线程关闭后资源回收的问题^!^如何解决
- 全局程序集安装后不能引用?
- 串口问题!
- 实现下面的功能,详情在下面!!!写全的全给分。
- 请问这个内容为表格的窗体应用,修改某一单元格内容并自动更新表格内容后,如何跳转到刚才编辑的那个单元格
- 当C#连接SQL时 我希望能在界面上显示程序每一步的状态。。。
- 那里有C#中高手看的电子书籍下载!!!!!!!!!!!!!!!!!!!!!!
- 怎样可以锁定窗口的位置,在用鼠标拖动窗口的标题栏时,窗口不移动?
- 版务 请EdwarddotNet和cjhhm; huguohong和xyz12340 进来解释一下你们之间的关系
剩下的还有吗
// 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);
}
}
不过不是要谢谢你们的回复都怪本机没有VS。NET只好辛苦你们啦