返回列表 發帖
  1. import java.io.Console;
  2. public class ch05{
  3.     public static void main(String args[]){
  4.         String z;
  5.         int x,y;
  6.         Console c=System.console();
  7.         System.out.print("請輸入x: ");
  8.         x=Integer.parseInt(c.readLine());
  9.         System.out.print("請輸入y: ");
  10.         y=Integer.parseInt(c.readLine());
  11.         if(x>y)
  12.         z=">";
  13.         else if(x<y)
  14.         z="<";
  15.         else
  16.         z="=";
  17.         System.out.println("x"+z+"y!");
  18.     }
  19. }
複製代碼

TOP

返回列表