返回列表 發帖

數學運算

  1. public class ch02
  2. {
  3.    public static void main(String args[])
  4.    {
  5.        System.out.println("5+3="+(5+3));
  6.        System.out.println("5-3="+(5-3));
  7.        System.out.println("5*3="+(5*3));
  8.        System.out.println("5/3="+(5/3));
  9.        System.out.println("5%3="+(5%3));
  10.    }
  11. }
複製代碼

  1. public class ch02  //類別
  2. {
  3.   public static void main (String arg[]) //方法
  4.   {
  5.     System.out.println ("7+7="+(7+7));
  6.     System.out.println ("7-7="+(7-7));
  7.     System.out.println ("7*7="+(7*7));
  8.     System.out.println ("7/7="+(7/7));
  9.     System.out.println ("7%7="+(7%7));
  10.   }
  11. }
複製代碼

TOP

  1. public class ch02
  2. {
  3.    public static void main (String args[])
  4.    {
  5.     System.out.println("7+1="+(7+1));
  6.     System.out.println("7-1="+(7-1));
  7.     System.out.println("7*1="+(7*1));
  8.     System.out.println("7/1="+(7/1));
  9.     System.out.println("7%1="+(7%1));
  10.    }
  11. }
複製代碼

TOP

  1. public class ch02 //類別
  2. {
  3. public static void main(String args[]) //方法
  4. {
  5.    //運作
  6.    System.out.println("5+3="+(5+3));
  7.    System.out.println("5-3="+(5-3));
  8.    System.out.println("5*3="+(5*3));
  9.    System.out.println("5/3="+(5/3));
  10.    System.out.println("5%3="+(5%3));
  11. }

  12. }
複製代碼

TOP

  1. public class ch02
  2. {
  3.        public static void main (String args[])
  4.        {
  5.               System.out.println("5+3="+(5+3));
  6.               System.out.println("5-3="+(5-3));
  7.               System.out.println("5*3="+(5*3));
  8.               System.out.println("5/3="+(5/3));
  9.               System.out.println("5%3="+(5%3));
  10.        }
  11. }
複製代碼

TOP

回復 1# tonyh


   
public class ch02
{
  public static void main(String args[])
  {
   System.out.println("5+3="+(5+3));
   System.out.println("c5+c3="+5+3);
   System.out.println("5-3="+(5+3));
   System.out.println("5*3="+(5*3));
   System.out.println("5/3="+(5/3));
   System.out.println("5%3="+(5%3));
   System.out.println("5^3="+(5^3));

  }
}

TOP

  1. public class ch02
  2. {
  3.        public static void main (String args[])
  4.        {
  5.               System.out.println("5+3="+(5+3));
  6.               System.out.println("5-3="+(5-3));
  7.               System.out.println("5*3="+(5*3));
  8.               System.out.println("5/3="+(5/3));
  9.               System.out.println("5%3="+(5%3));
  10.        }
  11. }
複製代碼

TOP

返回列表