blob: 77bbfe3435bbae71cc4c2bff02a93e4522e25dcf [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <stdio.h>
2#include <string.h>
3
4int
5main(int argc, char *argv[])
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;
27}