1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【实践课外】3.选择结构2/7-7 选择-K线图.c

30 lines
705 B
C

#include <stdio.h>
int main() {
double open, high, low, close;
scanf("%lf%lf%lf%lf", &open, &high, &low, &close);
if (close < open) {
printf("BW-Solid");
} else if (close > open) {
printf("R-Hollow");
} else {
printf("R-Cross");
}
if (low < open && low < close || high > open && high > close) {
printf(" with ");
if (low < open && low < close && high > open && high > close) {
printf("Lower Shadow and Upper Shadow");
} else if (low < open && low < close) {
printf("Lower Shadow");
} else { // high > open && high > close
printf("Upper Shadow");
}
}
return 0;
}