题目描述:给定一个字符串,判断该字符串是否是合法的IP地址。
代码实现:
#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
char ip_str[20];
cout<<"请输入ip:"<<endl;
cin>>ip_str;
const char* point = ".";
char* token = strtok(ip_str,point);
int i =