]>
Commit | Line | Data |
---|---|---|
28f540f4 RM |
1 | #include <stdio.h> |
2 | ||
3 | int | |
ebbad4cc | 4 | main (void) |
28f540f4 RM |
5 | { |
6 | char buf[80]; | |
7 | int i; | |
8 | int lost = 0; | |
9 | ||
29e25f6f | 10 | lost = (scanf ("%2s", buf) < 0); |
28f540f4 RM |
11 | lost |= (buf[0] != 'X' || buf[1] != 'Y' || buf[2] != '\0'); |
12 | if (lost) | |
13 | puts ("test of %2s failed."); | |
29e25f6f FB |
14 | lost |= (scanf (" ") < 0); |
15 | lost |= (scanf ("%d", &i) < 0); | |
28f540f4 RM |
16 | lost |= (i != 1234); |
17 | if (lost) | |
18 | puts ("test of %d failed."); | |
29e25f6f | 19 | lost |= (scanf ("%c", buf) < 0); |
28f540f4 RM |
20 | lost |= (buf[0] != 'L'); |
21 | if (lost) | |
22 | puts ("test of %c failed.\n"); | |
23 | ||
24 | puts (lost ? "Test FAILED!" : "Test succeeded."); | |
25 | return lost; | |
26 | } |