返回列表 發帖

五則運算 (二)

完成如下畫面


本帖隱藏的內容需要回復才可以瀏覽

本帖最後由 古蕾娜 於 2019-7-1 13:41 編輯
  1. public class Ch03
  2. {
  3.      public static void main(String args[])
  4.       {
  5.          int x=4,y=7;
  6.          System.out.println("When x equals to "+x+",y equals to "+y+"...");
  7.          System.out.println("x+y="+(x+y));
  8.          System.out.println("x-y="+(x-y));
  9.          System.out.println("x*y="+(x*y));
  10.          System.out.println("x/y="+(x/y));
  11.          System.out.println("x%y="+(x%y));

  12.       }
  13. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.    public static void main(String args[])
  4.    {
  5.        int x=5,y=3;
  6.        System.out.println("當x的值為"+x+",y的值為"+y+"時...");
  7.        System.out.println("x+y="+(x+y));
  8.        System.out.println("x-y="+(x-y));
  9.        System.out.println("x*y="+(x*y));
  10.        System.out.println("x/y="+(x/y));
  11.        System.out.println("x%y="+(x%y));


  12.    }
  13. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         int x = 4 , y =87 ;
  6.         System.out.println("當x的值為"+x+",y的值為"+y+"時...");
  7.         System.out.println("x+y="+(x+y));
  8.         System.out.println("x-y="+(x-y));
  9.         System.out.println("x*y="+(x*y));
  10.         System.out.println("x/y="+(x/y));
  11.         System.out.println("x%y="+(x%y));
  12.     }
  13. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.       int x=5,y=3;
  6.       System.out.println("當x的值為"+x+",y的值為"+y+"時...");
  7.       System.out.println("x+y="+(x+y));
  8.       System.out.println("x-y="+(x-y));
  9.       System.out.println("x*y="+(x*y));
  10.       System.out.println("x/y="+(x/y));
  11.       System.out.println("x%y="+(x%y));
  12.     }

  13. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.       int x=5,y=3;
  6.       System.out.println("當x值為"+x+",y值為"+y+"時...");
  7.       System.out.println("x+y="+(x+y));
  8.       System.out.println("x-y="+(x-y));
  9.       System.out.println("x*y="+(x*y));
  10.       System.out.println("x/y="+(x/y));
  11.       System.out.println("x%y="+(x%y));
  12.     }
  13. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.           int x=5, y=3;

  6.          System.out.println("當X的值為"+x+",y的值為"+y+"時...");
  7.          System.out.println("x+y="+(x+y));
  8.          System.out.println("x-y="+(x-y));
  9.          System.out.println("x*y="+(x*y));
  10.          System.out.println("x/y="+(x/y));
  11.          System.out.println("x%y="+(x%y));
複製代碼
回復 1# tonyh

TOP

  1. public class Ch03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.        int x=5, y=3;
  6.        System.out.println("當x的值為"+x+",y的值為"+y+"時...");
  7.        System.out.println("x+y="+(x+y));
  8.        System.out.println("x-y="+(x-y));
  9.        System.out.println("x*y="+(x*y));
  10.        System.out.println("x/y="+(x/y));
  11.        System.out.println("x%y="+(x%y));

  12.     }


  13. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.     public static void main (String args[])
  4.     {
  5.      int x=5,y=3;
  6.      System.out.println("當x的值為"+x+",當y的值為"+y+"時");
  7.      System.out.println("x+y="+(x+y));
  8.      System.out.println("x-y="+(x-y));
  9.      System.out.println("x*y="+(x*y));
  10.      System.out.println("x/y="+(x/y));
  11.      System.out.println("x%+y="+(x%y));
  12.     }




  13.   }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.    public static void main(String args[])
  4.    {
  5.        int x=5,y=3;
  6.        System.out.println("當x的值為"+x+",y的值為"+y+"時...");
  7.        System.out.println("x+y="+(x+y));
  8.        System.out.println("x-y="+(x-y));
  9.        System.out.println("x*y="+(x*y));
  10.        System.out.println("x/y="+(x/y));
  11.        System.out.println("x%y="+(x%y));


  12.    }
  13. }
複製代碼

TOP

  1. public class Cl03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         int x=5, y=3;
  6.         System.out.println("When x's value is "+x+" and y's value is "+y);
  7.         System.out.println("x+y= "+(x+y));
  8.         System.out.println("x-y= "+(x-y));
  9.         System.out.println("x*y ="+(x*y));
  10.         System.out.println("x/y= "+(x/y));
  11.         System.out.println("x%y= "+(x%y));
  12.     }
複製代碼

TOP

  1. public class CH03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         int x=5,y=3;
  6.         System.out.println("當X的值為"+x+",Y的值為"+y+"時...");
  7.         System.out.println("x+y="+(x+y));
  8.         System.out.println("x-y="+(x-y));
  9.         System.out.println("x*y="+(x*y));
  10.         System.out.println("x/y="+(x/y));
  11.         System.out.println("x%y="+(x%y));
  12.     }





  13. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.   public static void main(String args[])
  4.   {
  5.     int x=94,y=87;

  6.     System.out.println("當x的值為"+x+",y的值為"+y+"時...");
  7.     System.out.println("x+y="+(x+y));
  8.     System.out.println("x-y="+(x-y));
  9.     System.out.println("x*y="+(x*y));
  10.     System.out.println("x/y="+(x/y));
  11.     System.out.println("x%y="+(x%y));
  12.   }
  13. }
複製代碼

TOP

  1. {
  2.     public static void main(String args[])
  3.     {
  4.         int x=5, y=3;
  5.         System.out.println("當x的質為"+x+",y的質為"+y+"時...");
  6.         System.out.println("x+y="+(x+y));
  7.         System.out.println("x-y="+(x-y));
  8.         System.out.println("x*y="+(x*y));
  9.         System.out.println("x/y="+(x/y));
  10.         System.out.println("x%y="+(x%y));

  11.     }
  12. }
複製代碼

TOP

  1. public class ch03
  2. {
  3.   public static void main(String args[])
  4.   {
  5.     int x=5,y=3;
  6.     System.out.println("當x值為"+x+",當y值為"+y+"時...");
  7.     System.out.println("x+y="+(x+y));
  8.     System.out.println("x-y="+(x-y));
  9.     System.out.println("x*y="+(x*y));
  10.     System.out.println("x/y="+(x/y));
  11.     System.out.println("x%y="+(x%y));
  12.   }
  13. }
複製代碼
回復 1# tonyh

TOP

  1. public class Ch04
  2. {
  3.     public static void main(String args[])
  4.     {
  5.          int x=9846,y=4896,z=9487;
  6.          System.out.println("當x的值為"+x+",y的值為"+y+",z的值為"+z+"時...");
  7.          System.out.println("x+y+z="+(x+y+z));
  8.          System.out.println("x-y-z="+(x-y-z));
  9.          System.out.println("x*y*z="+(x*y*z));
  10.          System.out.println("x/y/z="+(x/y/z));
  11.          System.out.println("x%y%z="+(x%y%z));



  12.     }

  13. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         int x=5,y=3;
  6.         
  7.         System.out.println("當x的值為"+x+",y的值為"+y+"時...");
  8.         System.out.println("x+y="+(x+y));
  9.         System.out.println("x-y="+(x-y));
  10.         System.out.println("x*y="+(x*y));
  11.         System.out.println("x/y="+(x/y));
  12.         System.out.println("x%y="+(x%y));
  13.     }
  14. }
複製代碼

TOP

  1. public class Ch03
  2. {
  3.     public static void main(String args[])
  4.     {
  5.          int x=5,y=3;
  6.          System.out.println("當x的值為"+x+",y的值為"+y+"時...");
  7.          System.out.println("x+y="+(x+y));
  8.          System.out.println("x-y="+(x-y));
  9.          System.out.println("x*y="+(x*y));
  10.          System.out.println("x/y="+(x/y));
  11.          System.out.println("x%y="+(x%y));
  12.     }

  13. }
複製代碼

TOP

  1. public class Ch04
  2. {
  3.    public static void main(String args[])
  4.    {

  5.          int x=5,y=3;
  6.          System.out.println("當X的值為"+x+",y的值為"+y+"時....");
  7.          System.out.println("x+y="+(x+y));
  8.          System.out.println("x-y="+(x-y));
  9.          System.out.println("x*y="+(x*y));
  10.          System.out.println("x/y="+(x/y));
  11.          System.out.println("x%y="+(x%y));

  12.    }
  13. }
複製代碼

TOP

  1. public class CH03
  2. {
  3.   public static void main(String args[])
  4.   {
  5.     int x=5,y=3;
  6.     System.out.println("當X的值為"+x+",y值為"+y+"時...");
  7.     System.out.println("x+y="+(x+y));
  8.     System.out.println("x-y="+(x-y));
  9.     System.out.println("x*y="+(x*y));
  10.     System.out.println("x/y="+(x/y));
  11.     System.out.println("x%y="+(x%y));
  12.   }
  13. }
複製代碼

TOP

返回列表