bool f (const char *s) { int s1,s2,s3,s4; if (sscanf(s, "%d.%d.%d.%d", &s1, &s2, &s3, &s4) != 4) { return false; } if ((s1 & 0xffffff00) || (s2 & 0xffffff00) || (s3 & 0xffffff00) || (s4 & 0xffffff00)) { return false; } else { return true; } }
时间: 2024-10-06 08:22:16