输入任意一个字符串,判断是否为合法IP
1 bool IsIPAddress(const char * str){ 2 //先判断形式是否合法, 3 4 //检查是否只包含点和数字 5 for(int i = 0; str[i] != '