⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 complex.java

📁 some programs in java
💻 JAVA
字号:
/*
 * Complex.java
 *
 * Created on 17 octombrie 2007, 09:17
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package lab32;

/**
 *
 * @author Alina.Stanila
 */
class Complex
 {
   double re,im;
   Complex(double re,double im)
   {
    this.re=re;
    this.im=im;
   }

   Complex(Complex c)
   {
        re=c.re;
        im=c.im;
    }
   static double modul(Complex c)
   {
        return Math.sqrt(c.re*c.re+c.im*c.im);
   }
    
   public String toString()
   {
       return re+ "+i*" +im;
   }
   static Complex suma(Complex c1,Complex c2)
   {
    Complex c=new Complex(c1);
    c.re=c1.re+c2.re;
    c.im=c1.im+c2.im;
    return c;
   }
   
   static Complex produs(Complex c1, Complex c2)
   {
    Complex c=new Complex(c1);
    c.re=c1.re*c2.re;
    c.im=c1.im*c2.im;
    return c;
   }
 }


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -