1 /*
2 * Main.c
3 * 分支-15. 日K蠟燭圖
4 * Created on: 2014年6月18日
5 * Author: Boomkeeper
6 ****測試通過*****
7 */
8
9 #include <stdio.h>
10 #include <stdlib.h>
11
12 int main()
13 {
14 float open,close,high,low;
15
16 scanf("%f %f %f %f",&open,&high,&low,&close);
17
18 if(close<open)
19 printf("BW-Solid");
20 if(close>open)
21 printf("R-Hollow");
22 if(close==open)
23 printf("R-Cross");
24
25 if(low<open && low<close)
26 {
27 if(high>open && high>close)
28 {
29 printf(" with Lower Shadow and Upper Shadow");
30 exit(0);
31 }
32 printf(" with Lower Shadow");
33 }
34
35 if(high>open && high>close)
36 printf(" with Upper Shadow");
37
38 return 0;
39 }
題目鏈接:http://pat.zju.edu.cn/contests/basic-programming/%E5%88%86%E6%94%AF-15