Use the keyboard to enter two integers and display the minimum value. If the two numbers are equal, either number is displayed.
requirement:
The program should read these numbers from the keyboard.
The program must display a number on the screen.
The program should display the minimum of two integers.
If the two numbers are equal, either number is displayed.
package zh.codegym.task.task04.task0418;
/*
两个数字中的最小值
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//在此编写你的代码
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
String a = reader.readLine();
int S = Integer.parseInt(s);
int A = Integer.parseInt(s);
if(S>A){
System.out.println(A);
}
else if(A>S){
System.out.println(A);
}
else if(A==S){
System.out.println(s);
}
}
}