编程题:13
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double Open = scanner.nextDouble();
double High = scanner.nextDouble();
double Low = scanner.nextDouble();
double Close = scanner.nextDouble();

    String type;
    if (Close < Open) {
        type = "BW-Solid";
    } else if (Close > Open) {
        type = "R-Hollow";
    } else {
        type = "R-Cross";
    }

    String shadows = "";
    boolean hasLower = (Low < Open && Low < Close);
    boolean hasUpper = (High > Open && High > Close);

    if (hasLower && hasUpper) {
        shadows = " with Lower Shadow and Upper Shadow";
    } else if (hasLower) {
        shadows = " with Lower Shadow";
    } else if (hasUpper) {
        shadows = " with Upper Shadow";
    }

    System.out.println(type + shadows);
}

}

posted on 2025-05-12 23:21  Swishy  阅读(5)  评论(0)    收藏  举报