-->
当前位置:首页 > 题库

PROGRAMMING:Horizontal and vertical

Luz5年前 (2021-05-10)题库572
Fill in the blanks. According to the requirements of the title, improve the following code. Please submit the complete code.
If the height of a wood block is larger than the width, we say it is placed vertically, otherwise we say it is placed horizontally.
Read in the height and width of a block. If it is flat, output a, otherwise output B.

import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int height, width;
char status;
height = in.nextInt();
width = in.nextInt();
Board board = new Board(height, width);
status = board.getStatus();
System.out.print(status);
}
}
class Board{
int height, width;
public Board(int height, int width){
this.height = height;
this.width = width;
}
public char getStatus(){
if(height<= width){
return status(1);
}else{
return status(1.0);
}
}
public char status(double rate){
}
public char status(int rate){
}
}

###Input format:
Input two positive integers a and B with absolute value no more than 1000 in one line.
###Output format:
Output a character a or B on a line.
###Input example:
```in
50 50
```
###Output example:
```out
A
```






answer:If there is no answer, please comment