输入:

12.34.42.45

scanf("%d.%d.%d.%d", &a, &b, &c, &d);

则:

a = 12, b = 34, c = 42, d = 45