返回列表 發帖

五則運算 (二)

本帖最後由 tonyh 於 2012-7-28 16:40 編輯

利用+號, 將資料串接起來.
  1. public class ch3
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         System.out.println("3+5="+(3+5));
  6.         System.out.println("3-5="+(3-5));
  7.         System.out.println("3*5="+(3*5));
  8.         System.out.println("3/5="+(3/5));
  9.         System.out.println("3%5="+(3%5));
  10.     }
  11. }
複製代碼

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

TOP

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

TOP

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

TOP

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

TOP

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

TOP

  1. public class ch3
  2. {
  3.     public static void main(String args[])
  4.     {
  5.      System.out.println("3+5="+(3+5));
  6.      System.out.println("3-5="+(3-5));
  7.      System.out.println("3*5="+(3*5));
  8.      System.out.println("3/5="+(3/5));
  9.      System.out.println("3%5="+(3%5));

  10.     }

  11. }
複製代碼

TOP

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

TOP

返回列表