📄 textcomplex.java
字号:
import java.lang.*;
import javax.swing.*;
class Complex
{ private int x;
private int y;
public void setx(int x1)
{this.x=x1;}
public int getx()
{return x;}
public void sety(int y1)
{this.y=y1;}
public int gety()
{return y;}
Complex()
{x=0;y=0;}
Complex(int a)
{x=a;y=0;}
Complex(int a,int b)
{x=a;y=b;}
void mode()
{
System.out.println(Math.sqrt(x*x+y*y));
}
}
public class TextComplex
{ public static void main(String[] args)
{
Complex Complex1=new Complex();
Complex1.setx(1);
Complex1.sety(2);
Complex1.mode();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -