判断输入的字符串是不是iPv4地址。
代码:
#include "stdafx.h"
#include<string>
#include<vector>
#include<iostream>
using namespace std;
bool isipv4(string str)
{
vector<string> vec;
int index = 0;
int start = 0;
index = str.find('.',0);
while (index !=string::npos)
{
string strtemp = str.substr(start,index-start);
if (strtemp!="")
{
for(int j = 0;j< strtemp.length();j