]>
Commit | Line | Data |
---|---|---|
05be689b RM |
1 | #include <stdio.h> |
2 | #include <string.h> | |
3 | ||
11336c16 UD |
4 | int |
5 | main(int argc, char *argv[]) | |
05be689b RM |
6 | { |
7 | char buf[100]; | |
8 | int point, x, y; | |
9 | int status = 0; | |
10 | ||
11 | sscanf("0x10 10", "%x %x", &x, &y); | |
12 | sprintf(buf, "%d %d", x, y); | |
13 | puts (buf); | |
14 | status |= strcmp (buf, "16 16"); | |
15 | sscanf("P012349876", "P%1d%4d%4d", &point, &x, &y); | |
16 | sprintf(buf, "%d %d %d", point, x, y); | |
17 | status |= strcmp (buf, "0 1234 9876"); | |
18 | puts (buf); | |
19 | sscanf("P112349876", "P%1d%4d%4d", &point, &x, &y); | |
20 | sprintf(buf, "%d %d %d", point, x, y); | |
21 | status |= strcmp (buf, "1 1234 9876"); | |
22 | puts (buf); | |
23 | ||
24 | puts (status ? "Test failed" : "Test passed"); | |
25 | ||
26 | return status; | |
11336c16 | 27 | } |