/*找出最大值*/
import java.io.*;
class Sample5
{
public static void main(String[] args) throws IOException
{
System.out.println("請輸入兩個變數。");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str1=br.readLine();
String str2=br.readLine();
int num1=Integer.parseInt(str1); //準備好兩個整數值
int num2=Integer.parseInt(str2);
int ans=Math.max(num1,num2); //找出其中的最大值
System.out.println(num1 + "與" + num2 + "中較大的是" + ans + "。");
}
}
沒有留言:
張貼留言