Commit | Line | Data |
---|---|---|
fd15fd37 BJ |
1 | |
2 | Write a program which reads a character from its | |
3 | input and prints "high" if that character is | |
4 | larger than 100 in numeric value (decimal) and "low" | |
5 | if it is less than or equal to 100 in numeric value. | |
6 | Compile it as usual and then type "ready". | |
7 | #once #create Ref1 | |
8 | u is a big letter | |
9 | #once #create Ref2 | |
10 | B is a small letter | |
11 | #user | |
12 | a.out <Ref1 >test1 | |
13 | a.out <Ref2 >test2 | |
14 | grep high test1 >/dev/null && grep low test2 >/dev/null | |
15 | #succeed | |
16 | One way: | |
17 | ||
18 | main() | |
19 | { | |
20 | if (getchar() > 100) | |
21 | printf("high\n"); | |
22 | else | |
23 | printf("low\n"); | |
24 | } | |
25 | #log | |
26 | #next | |
27 | 5.1b 10 |