complextest.java
来自「真的是复数运算噢」· Java 代码 · 共 16 行
JAVA
16 行
public class ComplexTest{
public static void main(String [] args)
{
Complex a = new Complex (1,1);
Complex b = new Complex (1,-1);
Complex c = new Complex (a.real+b.real,a.image+b.image);
Complex d = new Complex (a.real-b.real,a.image-b.image);
Complex e = new Complex (a.real*b.real-a.image*b.image,a.real*b.image+a.image*b.real);
System.out.println(a.toString());
System.out.println(b.toString());
System.out.println(c.toString());
System.out.println(d.toString());
System.out.println(e.toString());
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?