#include <stdio.h>
void main()
{
int a;
char b[16];
int c;
char *p;
p = "12,34,56";
sscanf(p
, "%d,%s,%d", &a
, b
, &c
); printf("a=%d, b=%s, c=%d\n", a
, b
, c
);
p = "23 45 67";
sscanf(p
, "%d %s %d", &a
, b
, &c
); printf("a=%d, b=%s, c=%d\n", a
, b
, c
); }
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIG1haW4oKQp7CiAgICBpbnQgYTsKICAgIGNoYXIgYlsxNl07CiAgICBpbnQgYzsKCiAgICBjaGFyICpwOwoKICAgIHAgPSAiMTIsMzQsNTYiOwogICAgc3NjYW5mKHAsICIlZCwlcywlZCIsICZhLCBiLCAmYyk7CiAgICBwcmludGYoImE9JWQsIGI9JXMsIGM9JWRcbiIsIGEsIGIsIGMpOwoKICAgIHAgPSAiMjMgNDUgNjciOwogICAgc3NjYW5mKHAsICIlZCAlcyAlZCIsICZhLCBiLCAmYyk7CiAgICBwcmludGYoImE9JWQsIGI9JXMsIGM9JWRcbiIsIGEsIGIsIGMpOwp9