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

30 lines
705 B
C
Raw Normal View History

2024-10-23 03:12:50 +00:00
#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;
}